Setting Gum Animationchain Achx in Code
Last updated
Last updated
Gum objects support playing .achx animations. This enables the use of the familiar AnimationEditor to create texture-based animations for Gum objects. Note that AnimationChain animations are used to change texture or texture coordinates. These are typically used for animated characters in 2D games. AnimationChain animations cannot change the size, orientation, or other common Gum properties.
Glue Version 12 introduces automatic calling of AnimateSelf on the top-level Gum screen. If your Glue project is using an earlier version than version 12, you will need to explicitly add the following to your CustomActivity:
For more information on Glue versions, see the gluj/glux page.
For this example we will assume a Sprite named SpriteInstance.
This Sprite is contained in a page named MainMenuGum which is assumed to be inside a FlatRedBall Screen named MainMenu.
We can set the Sprite to be animated using the following code in CustomInitialize:
The Gum Sprite now animates when running the game.