上QQ阅读APP看书,第一时间看更新
Widget parameters
You can see more parameters below the Color Tint field. These are the widget's global parameters from the UIWidget
class—they are common to most NGUI widget components, such as UILabel
, UISprite
, and UIScrollbar
, since they are derived from it:
- Pivot: This is the widget's pivot point. This represents the static point from which the widget will resize itself:
- Left set of buttons: Horizontal pivot point
- Right set of buttons: Vertical pivot point
- Depth: Change this value to render a widget over another. The widget with the highest value is rendered on top. You can use the Back and Forward buttons or simply enter a number. Negative values are accepted.
- Size: This shows the widget's dimensions in pixels. It is grayed out here because the label's Overflow parameter is set to ResizeFreely and is automatic.
- Aspect: Select any of the following desired aspect ratio lock behaviors:
- Free: You are free to modify the widget's height and width as you wish—no aspect ratio is imposed
- BasedOnWidth: You are free to modify the width only—the height will adjust automatically to keep the current aspect ratio
- BasedOnHeight: You are free to modify the widget's height only—the width will adjust to keep the current aspect ratio
Below these parameters, you can see the Anchors group. We'll deal with them later since we need to have more widgets to really understand how they work.
We can now see how to display images!