Unity ngui tabview

Source: Internet
Author: User

Unity version: 4.5.1 ngui version: 3.5

Reference: http://blog.csdn.net/g__dragon/article/details/17242969,CSDN g_dragon

For more information about tabview, see the example in ngui, scenario examples \ scenes \ example 13-tabs.

1. Create a 2D UI using ngui, create a panel under the UI root, create two toggle under the panel, and create a tab key under the ngui as follows:

Open the new toggle In the widget wizard (legacy) panel:

 

2. Create two panels under the Panel to correspond to two toggle keys:

4. Associate the toggle key with the Panel, and add the script uitoggledobjects. CS for each toggle key:

5. Set the attributes of the two toggle keys:

Ui toggle (SCRIPT ):

Set Group to 1 (Same) in two toggle UI toggle (SCRIPT ),

Start state: Set whether to display the label at the beginning. Check the first label to be displayed, but not the rest;

Ui toggle objects (SCRIPT ):

In activate under UI toggle objects (SCRIPT) script, set the size value to 1 and drag the corresponding panel to the element. In this way, the toggle key displays Panel1, for example:

6. Now you can view the running effect:

When you click toggle 1, panel 1 is displayed. When you click toggle 2, panel 2 is displayed, and Panel 1 is initially displayed.

 

Summary:

Each tab in the reference link corresponds to a content, but content cannot be found in ngui, instead of panel. Logically speaking, it should also be a window;

Code: https://github.com/vitah-lin/Unity

Unity ngui tabview

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.