The GUI uses the basic function of the

Source: Internet
Author: User

1 GUI. Windows window


static function Window (Id:int, Clientrect:rect, Func:windowfunction, Text:string, Style:guistyle): Rect

Windowrect = GUI. Window (0, Windowrect, Domywindow, "My window");
(Note that after the form is created, remember to assign it to the form again)
Gui. Dragwindow (New Rect (0, 0, 10000, 10000));


2 Mathf.clamp Limit

static function Clamp (Value:float, Min:float, max:float): float

Limits the value of values between Min and Max, and returns min if value is less than min. Returns max if value is greater than max, otherwise returns value

3 GUI. Dragwindow ();//gui. Dragwindow () function must be written in the back of other code, otherwise there will be a scary thing


4 GUI. Toolbar Toolbar

public int toolbarint = 0;//is the index number of the selected button.
Public string[] toolbarstrings = new string[] {"Toolbar1", "Toolbar2", "Toolbar3"};
void Ongui () {
Toolbarint = GUI. Toolbar (New Rect (+,-), Toolbarint, toolbarstrings);
}

5 GUI. Box Draw Texture

Gui. Box (Rect (0,0,screen.width,screen.height), "This is a title");

6 Set GUI picture, select picture
6.1 Texture Set as GUI
6.2 Max size is set according to the size of the picture
6.3 format is set to TrueColor


7 GUI. Beginscrollview Start scrolling View
Returns the Vector2 type, modified by the scroll position scrollposition. The return value should be passed back to your variable, as shown in the following example.
We create a 100,100 scrolling view with scrolling content of 220,200, which is what we want to see larger than the scrolling view
Scrollposition = GUI. Beginscrollview (Rect (10,300,100,100), scrollposition, rect (0, 0, 220, 200));


Customizing skin usage Steps
1 Resource window create--"GUI skin--" Custom style, set the first off property (note the settings in the border property)
2 in Ongui Gui.skin = Customskin; (Assigned to the skin, otherwise it will be the default skin)
3 using GUI.skin.GetStyle ("WINDOWRECTB") when creating a window
eg.
WINDOWRECTB = GUI. Window (0, WINDOWRECTB, Mydowindow, "", GUI.skin.GetStyle ("WINDOWRECTB"));

The GUI uses the basic function of the

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.