NGUI Study Notes 1

Source: Internet
Author: User

One: Panel panels
1. Layering, there can be multiple empty pieces per layer in the Ngui
2. Create a panel:
Ngui->open->ui wizard-> Select layers in the Layer option, select the camera in the cameras option to create a successful
3. Add a script to the panel:
Create a new empty object under the Panel and add a panel script component to the empty object
You can then add the controls under this panel.

Two: Label text field
1. Adding a Label control to a panel
2. Adjust the corresponding properties in the Properties panel

Three: Message mechanism
1. Attach the script directly to the button, such as button, to implement OnClick () in the script to respond to the Click event
2. Using Sendmassage, add button massage components for the buttons, set target,function name,trigger,include children to respond to Trigger events, Then call the function method of the target object.
3. Using Uilistener, add the event listener component for the button. Then you can get the click event of the button in any script and get the method as follows:
Void Awake ()
{
Gameobject button = Gameobject.find ("this button");
Uieventlistener.get (Button). OnClick = The name of the method you want to invoke, if said to be a;
}

Void A (gameobject button)
{
.........
}

NGUI Study Notes 1

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.