I've been having some issues where if I attempt to resize a character's current frame as a dynamic sprite it doesn't actually update onscreen. Here's the code I'm using:
Code: ags
Hopefully, that's not too confusing - cloudsnew is just a struct where I'm storing all the extra variables relating to my character extender functions. If I add a line setting an object's graphic to CharacterFrame.Graphic the object graphic does change as I'd expect (so the frame itself is being resized correctly), but the character remains unchanged. Strangely, if I use a drawing surface on the dynamic sprite, then the character will update, but not otherwise. Is there some command I should be running in order for the character to update its graphic? I'm using CustomRes build 3.3.0, if that's relevant.
Thanks, and apologies if I'm missing something silly.
void CorrectSize(this Character*)
{
ViewFrame *CharacterFrame=Game.GetViewFrame(this.View, this.Loop, this.Frame);
if(CloudsNew[this.ID].Sprite!=null)
{
CloudsNew[this.ID].Sprite.Delete();
}
CloudsNew[this.ID].Sprite=DynamicSprite.CreateFromExistingSprite(CloudsNew[this.ID].FromGraphic, true);
CloudsNew[this.ID].Sprite.Resize(CloudsNew[this.ID].Width, CloudsNew[this.ID].Height);
CharacterFrame.Graphic=CloudsNew[this.ID].Sprite.Graphic;
}
Hopefully, that's not too confusing - cloudsnew is just a struct where I'm storing all the extra variables relating to my character extender functions. If I add a line setting an object's graphic to CharacterFrame.Graphic the object graphic does change as I'd expect (so the frame itself is being resized correctly), but the character remains unchanged. Strangely, if I use a drawing surface on the dynamic sprite, then the character will update, but not otherwise. Is there some command I should be running in order for the character to update its graphic? I'm using CustomRes build 3.3.0, if that's relevant.
Thanks, and apologies if I'm missing something silly.