Game Development Community

How to create an animated button in the GUI

by Ehrlich · in Torque Game Builder · 04/07/2008 (9:58 pm) · 4 replies

Hello there.

i've been thinkerin with the GUI of the TGB, and found out that there are options to create buttons with images and stuff, but i was wondering if it is possible to create similar buttons, but with animations... i dont know, somethin like creating and animation with the animaton builder, and then convertin it into a button on the GUI builder...

is it possible?... how can i doit?

thx in advance.

About the author

Computer Science Engineer, with interest in Graphicl Computing, unconventional I/O devices and Artificial Intelligence (for games)


#1
06/14/2008 (9:34 pm)
Yep, you could create an animated button, but you'll need to build the animation routine yourself. You could create a behavior to manage the animation...
#2
06/16/2008 (2:38 pm)
So, basically u say that i need to create a routine in which i programmatically change the image frame of certain button adn thats about it?... never thought on that possibility (still, i think the GUI builder needs a revamp).

i posted this question like 2 months ago now, and in the mean time, i basically dropped the idea of using the GUI builder, and made the menus like they were levels, but givin some spots button behviors and stuff...

i really couldnt understand how to skin the templates in the GUI builder and stuff, so i had to hardcode the menu system for my game.

anyway... thx for the tip, Amaranthia... i'll keep on thinkerin onto that and see what else can i come up with.
#3
08/13/2008 (9:12 pm)
Hi Ehrlichmann ,

One thing you can try by for animated button is through level instead of GUI. In level, you can create t2dAnimatedObject and get mouse event on these object. So it will work like button.


enjoy........
#4
08/14/2008 (10:46 pm)
Actually, thats what i did with the menu system used in my game... i created the menu as a level, and then used as many animated sprites and stuff as i thought i needed, and added the button behavior ...