Animated menu
by Very Interactive Person · in Torque Game Builder · 10/28/2006 (6:48 am) · 4 replies
I would like to create an animated menu, like the one I made in this game : www.firstrategames.com/demo.aspx?id=1
This example was done in Flash, I created a class for it, so I was able to do things like:
then I could add an eventlistener to this menu like this:
So, when you made a selection it would dispatch an onMenuSelection event, and send the command string with the event object.
When you roll over the mouse, the menu items appear one at a time. It looks a lot nicer then just showing all items at once. The menu class then checks the mouse position each "tick", and highlights the selected button. onRollOut, the menu items are hidden again.
Now, how would I do this in TGB/TGE? Is there a way I can script this? Or do I have to do this in C++? I'm just starting out with things like this.
This example was done in Flash, I created a class for it, so I was able to do things like:
myMenu.addMenuItem(buttonText, command);and
myMenu.addSeperator();
then I could add an eventlistener to this menu like this:
myMenu.addEventListener("onMenuSelection", this);So, when you made a selection it would dispatch an onMenuSelection event, and send the command string with the event object.
When you roll over the mouse, the menu items appear one at a time. It looks a lot nicer then just showing all items at once. The menu class then checks the mouse position each "tick", and highlights the selected button. onRollOut, the menu items are hidden again.
Now, how would I do this in TGB/TGE? Is there a way I can script this? Or do I have to do this in C++? I'm just starting out with things like this.
#2
I think I shouldn't make this a GUI element, but try to code it with sprites. I'm not sure this will work in TGB though. Is it possible to group objects, and detect mouseRollOut on that group? Or maybe I should just check if the mouse is still inside each tick.
10/29/2006 (1:42 am)
I don't really want to use Flash. And the Flash resource (gameswf, right?) doesn't support AS 2.0 anyway.I think I shouldn't make this a GUI element, but try to code it with sprites. I'm not sure this will work in TGB though. Is it possible to group objects, and detect mouseRollOut on that group? Or maybe I should just check if the mouse is still inside each tick.
#3
11/03/2006 (10:31 pm)
You could use TGB objects as a GUI... this was how the Animation Builder was done (in the storboard and frame windows), including the scroller bar.
#4
11/19/2006 (11:02 am)
That's how I did it. Works great.
Torque Owner Michael \"Evic\" Wales
I can't recall off the top of my head - been years since I looked at the resource. I know it's possible though - Venture Africa used a flash interface if I recall correctly.