Rotate Gui Elements
by Hans Egermeier · in Torque Game Builder · 06/27/2006 (4:59 am) · 13 replies
Greetings,
I am trying to rotate Gui Elements. To do this, I put an arrow in the GuiBuilder to the screen and name it with "SpeedArrow".
When I try to call:
SpeedArrow.setRotation(%someValue)
I get a message that the Method setRotation is unknown. Is it possible to rotate Gui Elements with setRotation or do I have to rotate it differently?
Thanks for helps
I am trying to rotate Gui Elements. To do this, I put an arrow in the GuiBuilder to the screen and name it with "SpeedArrow".
When I try to call:
SpeedArrow.setRotation(%someValue)
I get a message that the Method setRotation is unknown. Is it possible to rotate Gui Elements with setRotation or do I have to rotate it differently?
Thanks for helps
#2
in the console type the following:
you'll probably see setPosition() in there, but no setRotation(), share if this is not the case!
06/27/2006 (5:42 am)
You can set position but you can't rotate GUI elements as far as i know either. Also don't forget you can use the .dump() on GUI elements to see a list of all valid actions it can take!in the console type the following:
SpeedArrow.dump();
you'll probably see setPosition() in there, but no setRotation(), share if this is not the case!
#3
Hope this helps.
06/27/2006 (7:05 am)
I'm not sure - but can't you mount GUI elements to SceneObject? That way it might work - if they follow the SceneObjects rotation. You could then just use an invisible SceneObject for the mount.Hope this helps.
#4
06/27/2006 (7:07 am)
You can use the .attachGui() method to attach a gui to a sceneObject, but it still isn't going to rotate the Gui object (and the text within it). GuiObjects simply don't have that type of operation available to them.
#5
06/27/2006 (9:48 am)
Your best bet, as someone already suggested, is to make the arrow a static sprite.
#6
But The dump method is a general good advise, thank you a lot. And the idea with the invisible mount point is very good. I will try it...
06/28/2006 (2:54 am)
First of all thanks you for your rapid answers. I can't make the arrow to simply to a standard static sprite because the Arrow is in front of another Gui Element. So when I use a static Sprite for the arrow it will hill be hidden behind the other Gui Control. :-(.But The dump method is a general good advise, thank you a lot. And the idea with the invisible mount point is very good. I will try it...
#7
06/28/2006 (8:04 am)
Unfortunately there is no mount method for Gui Elements. I couldn't find the methos .attachGui either Stephen. But when you say it will still not rotate than I will search for a solution to bring static sprites in front of Gui Elements. Thank you a lot.
#8
tdn.garagegames.com/wiki/TGB/Reference:_t2dSceneObject_Mounting_Methods
Although i've yet to use it so i can't tell if it does the job...
06/28/2006 (8:14 am)
Hans, the 'attachGui(%guiControl, %sceneWindow, %sizeControl)' & 'detachGui()' methods are here (use search string 'attach') under the 't2dSceneObject Mounting Methods':tdn.garagegames.com/wiki/TGB/Reference:_t2dSceneObject_Mounting_Methods
Although i've yet to use it so i can't tell if it does the job...
#9
The GUI system is fairly easy to use, but because it doesn't integrate into the groups and layers system that TGB uses, it has quite a few limitations. I don't if this is fixable in the future though.
06/28/2006 (9:29 am)
Attachgui works well enough, aside from the fact that the GUI text is on top of everything else. I had to abandon it because of that and switch to a bitmap font system so my text could move infront of and behind my various sprites.The GUI system is fairly easy to use, but because it doesn't integrate into the groups and layers system that TGB uses, it has quite a few limitations. I don't if this is fixable in the future though.
#10
Also if you're pushing GUI elements to the display (using Canvas.pushDialog(...)) instead of .add-ing them as a child to an existing GUI object, you can actually specify a Z-order (eg "Canvas.pushDialog(, )" ).
Be careful, don't confuse this z-order with the sceneobject's 'Layer' parameter. setLayer() on sprites in TGB is completely separate from the layering/z-ordering used by the core Torque GUI stuff.
06/28/2006 (2:14 pm)
You can create an additional scenewindow above the GUI element(s) in order to layer the sprite above it. Keep in mind the scenewindow object itself is just a GUI element which can be ordered against all the others GUI elements. Also if you're pushing GUI elements to the display (using Canvas.pushDialog(...)) instead of .add-ing them as a child to an existing GUI object, you can actually specify a Z-order (eg "Canvas.pushDialog(
Be careful, don't confuse this z-order with the sceneobject's 'Layer' parameter. setLayer() on sprites in TGB is completely separate from the layering/z-ordering used by the core Torque GUI stuff.
#11
Thanks for any and all help
06/30/2006 (8:27 am)
I also had a question along these lines. I'm looking to make a GUI pop up and say "You Win!" and marquee across the given area. Is there a way to accomplish this? I can navigate around the GUI fairly well but don't know if there is a way to make some text or even a graphic marquee across the screen in the GUI Editor.Thanks for any and all help
#12
06/10/2009 (3:03 pm)
just change the visibility of the marquee.. marquee.visible option. Make it invisible until you win. you might run into some mouse trapping problems doing this though.
#13
I hope to buy TGB and port all my games to it (Druids Battle of Magic and Abra Academy), but I will really need to do some rotation/scale effects on the GUI... and also add particle writing effects to the texts... Is that possible in Torque?
08/25/2009 (10:25 pm)
Is there any progress on this?I hope to buy TGB and port all my games to it (Druids Battle of Magic and Abra Academy), but I will really need to do some rotation/scale effects on the GUI... and also add particle writing effects to the texts... Is that possible in Torque?
Torque Owner Philip Mansfield
Default Studio Name