Add flexibility for controls

Apr 5, 2012 at 10:47 PM


I have tried to create a new Control "AnimatedImage" (it's a sprite animation stored in one texture with a framecount and a framerate) but there is 2 issues.

First issue:
To update my rectange object for draw the correct frame there is no update or beginRender method to retrieve the game time. It's possible to add more flexibility on the control class with adding an "update" or "beginRender" method with a gametime ?

Second issue:
My render method of my "AnimatedImage" class is called only one time and after the control is cached in the "Screen" class but this behavior is not compatible with my class that is dynamic.

There is a solution to quickly fix my issues ?

Thank you in advance.

Apr 6, 2012 at 11:25 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Apr 6, 2012 at 11:30 AM

I'll see what I can do to support this in the future. Probably the best would be to give you the ability to retrieve an instance of the GameTime stored in the GuiManager as a property and updated every frame...

As for the second issue, this is easily solved by adding a call to Invalidate() just after your animation frame pointer changes so that it tells the system to call Refresh() ;)