Game Development Community

GuiControl fields and their purposes

by Doctor Fail · in Torque 2D Beginner · 11/13/2013 (4:07 pm) · 5 replies

Ok, can anyone tell me what the
vertSizing,
horizSizing,
canSave,
hovertime,
Variable,
and Active
fields are for under GuiControls? More specifically, what they do, and how they should properly be used? I've been messing around with some guicontrols for a little bit now, and I tried changing them around, but there's no visible effect.

#1
11/14/2013 (5:02 am)
variable - Name of the variable to which the value of this control will be synchronized. Use this when you want a specific variable to update based on when the GUI control updates.

vertSizing - The vertical resizing behavior. This will control how the GUI control and its children resize when the Canvas or its parent are resized.

horizSizing - The horizontal resizing behavior. This will control how the GUI control and its children resize when the Canvas or its parent are resized.

hovertime - Time for mouse to hover over control until tooltip is shown (in milliseconds). Useful for GUI controls where you want pop-up text when the user hovers over a control.

active - Whether the control is enabled for user interaction. Set this to false when you want a GUI control to not have interaction for whatever reason.

canSave - Whether the GUI will be saved with changes to the default property values (Legacy). This was mainly useful for when there was a GUI editor. Not much reason to use it now.
#2
11/14/2013 (6:51 am)
The documentation contains this information and more - just select the "Reference Guide" tab in the index tool on the left, then browse the class list for your particular control or sift through the other sections. Plenty of info, just have to read it.

By the way, you'll also find a more comprehensive (though still confusing IMO) explanation of how the horizSizing and vertSizing fields work -
Horizontal sizing behavior of a GuiControl.

Enumerator:
right
width
left
center
relative
windowRelative

enum GuiVerticalSizing
Vertical sizing behavior of a GuiControl.

Enumerator:
bottom
height
top
center
relative
windowRelative

If you want to call it an "explanation" - at least it lays out your options, you'll have to experiment to see how it all works together.
#3
11/14/2013 (7:05 am)
What Richard said. I grabbed the info I posted straight from those docs.
#4
11/14/2013 (4:51 pm)
Thanks for the responses! How well does the Gui system for T3D port for T2D?
#5
11/15/2013 (6:36 am)
They're pretty close - they both came from TGE originally and the GUI system is one part that really didn't drift much.