Torque engine series GUI Editor

Source: Internet
Author: User

I. Gui editor Overview:
1. After Entering the game, press the F10 shortcut to enter the GUI editor. Shows the interface:

2. Gui editor consists of four parts: Content Editor, control tree, control insepctor, and tool bar. Content Editor is a large rectangular area in the upper-left corner, where controls are placed, moved, and transformed. The Control tree is located in the upper-right corner of the Control tree. It displays the hierarchy of the current content control. Insepctor is the place where the selected control property is displayed, located in the lower right corner of the GUI editor. The tool bar (toolbar) is used to create, align, and save edited controls and guis.
3. control attributes: all controls in torque GUI have the following attributes: simbase, parent, tooltip, l18n, and dynamic fields. In addition to the common property classes, there are also the property classes of the control itself. For example, the generl attribute class of the guiwindowsctrl control and the MISC attribute class of the guibuttonctrl control. The parent property is actually the property of the guicontrol control. The guicontrol class is the base class of all controls, and the simbase is the base class of the guicontrol class. Therefore, each control inherits the attributes of the above two base classes. The default values are generally used for attributes in the simbasl column.
The attributes of the parent attribute class are described as follows:
Profile = "guidefaultprofile"; // shape
Horizsizing = "right"; // Horizontal Alignment
Vertsizing = "bottom"; // Vertical Alignment
Position = "0 0"; // control vertex coordinate in the upper left corner
Extent = "800 600"; // control size
Visible = "1"; // visible
Bitmap = ""; // bitmap
Autosize = true; // automatic size
Maxlength = 255; // maximum length
Resizewidth = false; // whether the width can be adjusted
Resizeheight = false; // whether the height can be adjusted
Command = "Quit ();"; // click to execute the command
Accelerator = "escape"; // shortcut key

Tooltip attributes are described as follows)
Tooltip profile = "guitooltipprofile"; // shape, used to set the font size, color, and other appearances
Tooltip = "Adjust basic video, sound and other options"; // prompt string
Hovertime = 1000; // This property generally uses the default value (1000 ).

4. Profile parameter description: The main function of profile is to provide a rule template for the GUI, it defines the font, color, transparency, fill color, bitmap information, alignment, sound (button control) of the interface.
Tab = false; // whether the tab key can be used
Cankeyfocus = false; // key focus
Hasbitmaparray = false; // whether it is a bitmap Array
Mouseoverselected = false; // whether the selection can be completed by the mouse

Opaque = false; // whether transparent
Fillcolor = "240 240 240"; // fill color
Fillcolorhl = "150 180 200"; // highlight the fill color
Fillcolorna = "150 210 210"; // not active fill color

Border = false; // specifies whether a boundary exists.
Bordercolor = "0 0 0"; // border color
Bordercolorhl = "179 134 94"; // highlight fill color
Bordercolorna = "126 79 37"; // not active fill color

Bevelcolorhl = "255 255 255"; // color when the slope is highlighted
Bevelcolorll = "0 0 0"; // color when the bevelcolorll is low

Fonttype = ""; // font type
Fontsize = 12; // font size
Fontcharset = "gb2312"; // font Encoding

Fontcolor = "0 0 0"; // normal text color
Fontcolorhl = "32 100 100"; // color in highlighted text
Fontcolorna = "0 0 0"; // color in the text not active state
Fontcolorsel = "0 0 200"; // color of the selected text

Bitmap = "~ /Client/UI/bitmaps/roots/window "; // bitmap Information
Textoffset = "0 0"; // text Offset Value

Modal = true; // whether it is in the Mode
Autosizewidth = false; // whether to adjust the width automatically
Autosizeheight = false; // whether to automatically adjust the height
Numbersonly = false; // whether it is only a number (used in the text editing box)
Cursorcolor = "0 0 0 255"; // cursor color

Soundbuttondown = ""; // sound effect when the button is pressed
Soundbuttonover = ""; // The button is out of date.
The above are some parameters and descriptions of the profile. soundbuttondown and soundbuttonover are the buttons.

5. How to add the attributes of a widget to the engine:
Void guibitmapbuttonctrl: initpersistfields ()
{
Parent: initpersistfields ();
Addfield ("bitmap", typefilename, offset (mbitmapname, guibitmapbuttonctrl ));
Addfield ("shinefreq", types32, offset (mshinefreq, guibitmapbuttonctrl); // The flashing frequency attribute
}
As shown in the example, In the initpersistfields () function, use the addfield method to add.

6. why can't the GUI file list be displayed in the file directory when saving the GUI file:
The most likely reason is that your project file directory contains Chinese characters, and the torque Chinese support is unfriendly, so it cannot be displayed. Solution: when a project is created, the directory cannot contain Chinese characters.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.