Unity Note Editor (Beginfadegroup, Beginhorizontal, Beginscrollview) ...

Source: Internet
Author: User

1. Beginfadegroup (float value)this is a function in editorguilayout that hides/displays the contents of the group it contains. Value is the amount of content that is displayed, and the range is 0-1. Compare windows that are not used/used Beginfadegroup: [Code]csharpcode:
Using unityengine;using system.collections;using unityeditor; Reference to the editor namespace public class Editor2:editorwindow//editor class {    [MenuItem ("Editordemo/createwindow")]//Add a menu    to the editor static void CreateWindow ()//The following function must be * * * static    {        //In this case Create window        Editorwindow.getwindow (typeof (Editor2), False, "Editorwindow", True);    }    void Ongui ()    {        editorguilayout.beginfadegroup (0.5f);//Group start        Guilayout.button ("Button0");//The contents of the group, I wrote this 3 button        Guilayout.button ("Button1");        Guilayout.button ("Button2");        Editorguilayout.endfadegroup (); Group End    }}

We set the value to 0.5, which is the display 50%; set to 0.75, which is the display 75%.

2. Beginhorizontal ()

Often different GUIs are arranged one by one, and the Beginhorizontal function can display the contents of the group in the same row. (Beginvertical () is the vertical axis arrangement, the use of the same, I will not repeat it)

[Code]csharpcode:
Using unityengine;using system.collections;using unityeditor; Reference to the editor namespace public class Editor2:editorwindow//editor class {    [MenuItem ("Editordemo/createwindow")]//Add a menu    to the editor static void CreateWindow ()//The following function must be * * * static    {        //In this case Create window        Editorwindow.getwindow (typeof (Editor2), False, "Editorwindow", True);    }    void Ongui ()    {        editorguilayout.beginhorizontal ();//Group start        Guilayout.button ("Button0");//The contents        of the Group Guilayout.button ("Button1");        Editorguilayout.endhorizontal (); Group End    }}

Compare the unused/used beginhorizontal windows:

3. Beginscrollview ()

The Beginscrollview function can provide a sliding space for a GUI with a large width or height.

[Code]csharpcode:
Using unityengine;using system.collections;using unityeditor; Reference to the editor namespace public class Editor2:editorwindow//editor class {    Vector2 _scrollpos;    [MenuItem ("Editordemo/createwindow")]//Add a menu in the editor    static void CreateWindow ()//The following function must be * * * static    {        In this case, create the window        Editorwindow.getwindow (typeof (Editor2), False, "Editorwindow", true);    void Ongui ()    {        _scrollpos = Editorguilayout.beginscrollview (_scrollpos);//Group start        Editorguilayout.labelfield ("I am the woo, the small cheap I am the woo, the small base I am the woo, the small base I am the woo, the small base"); The contents of the group        Editorguilayout.labelfield ("I am xiaojian I am xiaojian I am xiaojian I am Xiaojian");        Editorguilayout.endscrollview (); Group End    }}

Compare windows that are not using/using Beginscrollview:

is not all very simple, those who want to give their own project to do some plug-in children's shoes are all eager!

(GO) Unity Note Editor (Beginfadegroup, Beginhorizontal, Beginscrollview) ...

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.