- Adding GUI Elements
To add GUI elements, follow the steps below:
![]() |
Go to Widget Tools On the drop down menu next to the word "Template", you can choose what elements to add. |
- Different Elements
Label
Labels are simple text boxes
Sprite
Sprites are simple textures, they can act as background, decors, etc. There are 4 kinds of Sprites:
- Simple - A sprite that is spawned at the texture resolution. You can scale them but they will be distorted on scaling.
- Sliced - A sprite that is spawned at texture resolution. Scaling them will ignore the border and scale at the center.
- Tiled - A sprite that is spaned at texture resolution. Scaling them will tile them.
- Filled - A sprite that is spawned at texture resolution. You can change the fill amount. For example, a health bar will be made to proportionate the fill amount to current health.
Button
Buttons are simply spawning a Label on top of a background (sprite). NGUI does this automatically and will scale the whole thing to the right size. A collider is also added to capture the on click event.
Texture
A texture is used to add a simple texture to the scene. It is used to for texture not added to the Atlas prefab. Since it requires full self-customization (like manually adding scripts components), it is not recommended to be used.
Progress Bar
Progress bar is used to make fill-able bars like timers, health/mana bars, etc. It is comprised of 2 sprites, a simple and a filled.
Input
Input can be used to make a type-able box for use in chatboxes.
沒有留言:
張貼留言