- Home /
EZGUI / SM2 - Each UIButton state as an animated texture
Hi,
I'm just learning to use EZGUI 1.07 and SM2 and am trying to create a GUI which is a clickable TV screen. Prior to trying to convert it into a clickable GUI, I would use the space key to go from one screen on the TV which is an animated texture (which would use a script similar to this to display each tile in turn), to transition to the next texture which is another animated texture.
Now, my question is how would I go about having each of the states/elements in the UIButton component in EZGUI (Normal, Over, Active, Disabled) be an animated texture itself. I am able to create an animated texture with its own atlas using SM2 and the 'Sprite Timeline', but how would I tell the UIButton script to use this texture as one of its states?
Thanks
Answer by robertbu · Jan 10, 2013 at 01:30 AM
Select your UIButton in the hierarchy and select UI Control Editor from the Windows menu. Select a state at the top of the UI Control Editor, and then just drag all the frames onto the lighter gray rectangle to create the animation for that state. Build your atlas and everything should be handled automatically.