-
Notifications
You must be signed in to change notification settings - Fork 1
Images
Name |
Type |
Default |
Explanation |
---|---|---|---|
autoSizeHeight |
bool |
false |
Control's height shall fit its contents. See also autoSizeWidth. |
autoSizeWidth |
bool |
false |
Control's width shall fit its contents. See also autoSizeHeight. |
bevelColorHL |
Color4I |
0 0 0 0 |
The color of the bevel's highlight part. |
bevelColorLL |
Color4I |
0 0 0 0 |
The color of the bevel's lowlight part. |
bitmap |
filename |
none |
The file name (or path) for the image file (PNG, JPG, etc.) to use for this control. Note: certain GuiControl classes use this bitmap [[#Parsing_the_Bitmap|parsed into multiple pieces. |
border |
integer |
1 |
For most controls, if border is greater than 0, a border will be drawn. Some controls use this member to draw different types of borders. |
borderThickness |
integer |
1 |
Thickness of the control's border. |
borderColor |
Color4I |
040 040 040 100 |
The color to use for the border of the control. |
borderColorHL |
Color4I |
128 128 128 255 |
The color to use for the border of the control when the control is highlighted. |
borderColorNA |
Color4I |
064 064 064 255 |
The color to use for the border of the control when the control is not active. |
canKeyFocus |
bool |
false |
Whether this control can become the focus for keyboard events (key presses). |
cursorColor |
Color4I |
000 000 000 255 |
The color of the insertion point (blinking I-beam) cursor in an EditText control. |
fillColor |
Color4I |
211 211 211 255 |
The color for the interior of the control. |
fillColorHL |
Color4I |
244 244 244 255 |
The color for the interior of the control when the control is highlighted. |
fillColorNA |
Color4I |
244 244 244 255 |
The color for the interior of the control when the control is not active. |
fontCharset |
enum |
ANSI |
The output encoding of the font to use. One of ANSI,?? |
fontSize |
integer |
14 |
The size of the font in points. |
fontType |
string |
Arial |
The name of the font, along with other modifiers, like "bold". |
fontColor |
Color4I |
000 000 000 255 |
Color of the font. |
fontColors |
Color4I |
000 000 000 255 |
Unknown. |
fontColorHL |
Color4I |
032 100 100 255 |
Color of the font when the control is highlighted. |
fontColorSEL |
Color4I |
200 200 200 255 |
Color of the font when the control or the text field is selected. |
fontColorNA |
Color4I |
000 000 000 255 |
Color of the font when the control is not active. |
fontColorLink |
Color4I |
000 000 000 000 |
Font color for a hyperlink. |
fontColorLinkHL |
Color4I |
000 000 000 000 |
Font color for a highlighted hyperlink. |
fontColors_0..9 |
Color4I |
000 000 000 255 |
Different members of this array of font colors is devoted to particular GuiControl classes. GuiMLTextProfile, GuiConsoleProfile, and others. |
justify |
left, center, right |
right |
Justification of the text of the control. |
textOffset |
Vector2I |
0 0 |
Offset, in points, of the text of the control. |
Modal |
bool |
false |
Whether the control should make the UI modal (prevent the user from doing anything outside of the control). |
mouseOverSelected |
bool |
false |
Whether the control should be "selected" when the mouse hovers over it. |
numbersOnly |
bool |
false |
Whether the text of the control should be restricted to numerical characters only. |
opaque |
bool |
false |
Whether the control should be opaque. |
tab |
bool |
false |
Whether the user can switch focus to this object by using the tab key. |
returnTab |
bool |
false |
Whether a tab-event should be simulated when the return key is pressed. (Used in the EditorTextEdit profile.) |
profileForChildren |
object |
none |
When the control is used as a container for other controls, this field specifies the profile to use for those child controls. Profiles that specify this field: EditorListBoxProfile EditorPopupMenu EditorPopupMenuLarge EditorTabBook GuiFormProfile GuiPopUpMenuDefault GuiPopUpMenuEditProfile T2DDatablockDropDownProfile. |
soundButtonDown |
AudioProfile |
none |
Sound profile to use for the sound to produce when the button (control) is pressed. |
soundButtonOver |
AudioProfile |
none |
Sound profile to use for the sound to produce when the mouse hovers the control. |
Open your project up again and load the inventoryGui.gui file. Select the title control GuiTextCtrl set its profile property:
GuiListBoxCtrl property name: lstInventory GuiListBoxCtrl property profile: InvList GuiListBoxCtrl property fitParentWidth: checked
Before we add functionality via script we need to add one last set of controls: our bitmap buttons.
Hint: GuiBitmapButtonCtrl can be found in the Library > Buttons category.
Hover - aRaLogoIcon_h.png Down - aRaLogoIcon_d.png
HINT: Remember you can use the icons in the tool bar to line up and distribute the controls evenly. HINT: The tool bar icons will display a tool hint if you hover the mouse over them.
Button 2 property name: btn2 Button 3 property name: btn3 Button 4 property name: btn4
Button close property Bitmap: game/art/images/inventoryClose (again leave off the file extension)
Now that all of the controls are in place, we need to make it all do something. Making sure you have saved your GUI, close down Torque 3D and open your favorite script editor. Create a new script file in scripts/gui/ called InventoryGui.cs.
// //global arrays for initial content to be displayed //
exec("scripts/gui/InventoryGui.cs");
We are going to make our final edits in the editor. Run the GUI Editor and load your inventoryGui. Each button now needs to be linked to our new functions. Set the following properties to our buttons:
btn2 property command: inventoryGui.btn2(); btn3 property command: inventoryGui.btn3(); btn4 property command: inventoryGui.btn4(); btnClose property command: Canvas.popDialog(inventoryGui);
In this tutorial, you learned the following concepts:
|