A T2D GUI system
by Matthew Langley · in Torque Game Builder · 04/22/2005 (3:31 pm) · 30 replies
T2D Gui Creator Avi
Ok... well today I've been working a T2D GUIsystem... due to the added functionality of T2D objects over the Torque GUI (though the Torque GUI still has its place) I decided to start creating an easy to use T2D gui system...
right now I have imageButtons and blendButtons working...
if you hover over the image button it switches out the objects image to the image you have attached to it at
%obj.overImageMap
same with
%obj.downImageMap
and
%obj.defaultImageMap
Everything resets itself right now, you hove over it, it changes images, you hover off of it, it changes back... you click it then it changes images, if you click it while over it and let go it will change images appropriately to the over image and not the default...
the blend button works similarly
you set these instead
%obj.overBlendColour
%obj.downBlendColour
%obj.defaultBlendColour
it updates correctly as well
I have started adding some actions in... right now have one over action...
"displayImage"
if you set its action to this it will display a specified image at a specified postion, with a specified size... when you are no longer over it, it then safeDeletes it... I'll add a stick option later to have it stick until the next hover image is active (or something similar)...
right now I have this all down to a single function to create
that function will create a basic button, I'll extend it to include action settings in one line as well
I also plan on adding animated buttons, so nifty little animated settings :) I also have been working on a simple little animation queueing system in script (when onAnimationEnd works properly I'll post it as to not confuse anyone any more lol, btw definately not a shot at Melv, you work too hard man! Can't beleive all the things you and Josh addressed in the last update!) and then I'll probably set it up to receive animation queues as states
the blend buttons allow for creating multiple buttons and states off of the same button
the goal will to eventually create a little tool where you can move and design GUIs, test them, then save it off... after that I'll make it so you can bring the tool in over your game, somewhat like the present Gui Editor... at least thats my goal now...
heres some very simple pics using stock T2D images
heres the screen ... top three boxes (small ones) are blend buttons with actions attached, the bottm left big one is a generated imageButton and the bottom right is a generated blendButton

the next three images show the over blend color changes and the "displayImage" action



this one shows the onMouseOver for the imageButton

this one shows the onMouseDown for the imageButton

and here is the mouseOver for the blend button... lol very dark blend colour ;)

Ok... well today I've been working a T2D GUIsystem... due to the added functionality of T2D objects over the Torque GUI (though the Torque GUI still has its place) I decided to start creating an easy to use T2D gui system...
right now I have imageButtons and blendButtons working...
if you hover over the image button it switches out the objects image to the image you have attached to it at
%obj.overImageMap
same with
%obj.downImageMap
and
%obj.defaultImageMap
Everything resets itself right now, you hove over it, it changes images, you hover off of it, it changes back... you click it then it changes images, if you click it while over it and let go it will change images appropriately to the over image and not the default...
the blend button works similarly
you set these instead
%obj.overBlendColour
%obj.downBlendColour
%obj.defaultBlendColour
it updates correctly as well
I have started adding some actions in... right now have one over action...
"displayImage"
if you set its action to this it will display a specified image at a specified postion, with a specified size... when you are no longer over it, it then safeDeletes it... I'll add a stick option later to have it stick until the next hover image is active (or something similar)...
right now I have this all down to a single function to create
createNewBlendButton(tileMapImageMap, "25 25", "button4", "155 155 155", "0 0 0", "255 255 255", "10 10"); createNewImageButton(tileMapImageMap, "-25 25", "button5", ggLogoImageMap, shipImageMap, "10 10");
that function will create a basic button, I'll extend it to include action settings in one line as well
I also plan on adding animated buttons, so nifty little animated settings :) I also have been working on a simple little animation queueing system in script (when onAnimationEnd works properly I'll post it as to not confuse anyone any more lol, btw definately not a shot at Melv, you work too hard man! Can't beleive all the things you and Josh addressed in the last update!) and then I'll probably set it up to receive animation queues as states
the blend buttons allow for creating multiple buttons and states off of the same button
the goal will to eventually create a little tool where you can move and design GUIs, test them, then save it off... after that I'll make it so you can bring the tool in over your game, somewhat like the present Gui Editor... at least thats my goal now...
heres some very simple pics using stock T2D images
heres the screen ... top three boxes (small ones) are blend buttons with actions attached, the bottm left big one is a generated imageButton and the bottom right is a generated blendButton
the next three images show the over blend color changes and the "displayImage" action
this one shows the onMouseOver for the imageButton
this one shows the onMouseDown for the imageButton
and here is the mouseOver for the blend button... lol very dark blend colour ;)
About the author
I Manage Tool Development for Torque at InstantAction
#22
04/29/2005 (3:50 pm)
Got these actions working for loading whole guis... :) basically have each gui mounted to an fxSceneObject2D that can control movement for all... maybe even scale soon
#23
right now you can create a new T2D Gui... add buttons to it (it keeps a visual list of them)...theres an add button interface... for blend buttons theres a little preview button so you can set blend modes with real-time results using sliders for the R G and B... you can either zoomed the preview in to full size of the little preview window or make it "Full Screen" so it simulates to entire window in the little one... you click a set position button and move on screen and click a position and it stores that position... all the create option are working as modify options too, so if you select it in the list and click modify button it will bring up the same window to modify them...
still need to add actions to the gui and load of actions into the gui...
I'll try and post some pics later :)
05/05/2005 (6:57 pm)
I'll throw some screenshots up later, maybe even a little demo ... but I have a 'basic' Gui Creator working... still implimenting a lot of things... found out creating large scale guis like this takes a lot of time... I'm probably going on 10 -12 hours just creating the GUI interface to create gui interfaces lol... I've spent many more hours working on the scripting back end that allows for T2D Gui blend/image/animated buttons actions for flyingin from left,right,bottom,top, specified position, and fading in and out... I have the save system working though still need to integrate it into the gui...right now you can create a new T2D Gui... add buttons to it (it keeps a visual list of them)...theres an add button interface... for blend buttons theres a little preview button so you can set blend modes with real-time results using sliders for the R G and B... you can either zoomed the preview in to full size of the little preview window or make it "Full Screen" so it simulates to entire window in the little one... you click a set position button and move on screen and click a position and it stores that position... all the create option are working as modify options too, so if you select it in the list and click modify button it will bring up the same window to modify them...
still need to add actions to the gui and load of actions into the gui...
I'll try and post some pics later :)
#27
Your really gonna have to quit doing this stuff!
My teammates are gonna kill me if i quit our TGE project and come back to T2D.
Im putting in one vote for banning matt from the forums till my project is done, all his tuts and projects are killing my productivity!
Keep up the great work Matt. :)
05/07/2005 (10:10 am)
Dude,Your really gonna have to quit doing this stuff!
My teammates are gonna kill me if i quit our TGE project and come back to T2D.
Im putting in one vote for banning matt from the forums till my project is done, all his tuts and projects are killing my productivity!
Keep up the great work Matt. :)
#28
You must come to the dark side lol.
One of my goals for this Gui System and Creator is to add more options for people who integrate T2D with TGE, so you can overlay the T2D fancy fade in and fly in and out guis over TGE games.
05/11/2005 (11:48 am)
Thanks for the kind words Chris :)You must come to the dark side lol.
One of my goals for this Gui System and Creator is to add more options for people who integrate T2D with TGE, so you can overlay the T2D fancy fade in and fly in and out guis over TGE games.
#29
Where can I get the specified GUI editor or get the related source code .
I want to have some simply method to edit the game's GUI .
Thanks.
10/06/2005 (6:36 am)
@Matthew Where can I get the specified GUI editor or get the related source code .
I want to have some simply method to edit the game's GUI .
Thanks.
#30
11/24/2005 (9:34 am)
Is the source code available somewhere?
























Torque 3D Owner Matthew Langley
Torque
flyfromleft
flyfromright
flyfromtop
flyfrombottom
flyfrompos
you can specify a speed as well as an offset...
speeds are
fly020
that would be 20 speed
so
fly020fromleft
would cause the object/button to fly into the set position from just outside the left of the screen at 20
fly020fromleft20
instead of assuming you want to do it from just outside of the screen that would do it at an offset of 20 to the left
fly020fromposx20y20
would have the object/button fly from x: 20 y: 20 to the set position at speed 20 :)
again this will all be controlled from a gui in the end, so its broken down into one clump parameter and parsed out from there
btw If anyone has any suggestions of what to add I'm still open to them, for those that might be following my boring thread lol