NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UIStretch Class Reference

This script can be used to stretch objects relative to the screen's width and height. The most obvious use would be to create a full-screen background by attaching it to a sprite. More...

Inheritance diagram for UIStretch:

Public Types

enum  Style {
  Style.None, Style.Horizontal, Style.Vertical, Style.Both,
  Style.BasedOnHeight, Style.FillKeepingRatio, Style.FitInternalKeepingRatio
}
 

Public Attributes

Camera uiCamera = null
 Camera used to determine the anchor bounds. Set automatically if none was specified. More...
 
GameObject container = null
 Object used to determine the container's bounds. Overwrites the camera-based anchoring if the value was specified. More...
 
Style style = Style.None
 Stretching style. More...
 
bool runOnlyOnce = true
 Whether the operation will occur only once and the script will then be disabled. Screen size changes will still cause the script's logic to execute. More...
 
Vector2 relativeSize = Vector2.one
 Relative-to-target size. More...
 
Vector2 initialSize = Vector2.one
 The size that the item/image should start out initially. Used for FillKeepingRatio, and FitInternalKeepingRatio. Contributed by Dylan Ryan. More...
 
Vector2 borderPadding = Vector2.zero
 Padding applied after the size of the stretched object gets calculated. This value is in pixels. More...
 

Detailed Description

This script can be used to stretch objects relative to the screen's width and height. The most obvious use would be to create a full-screen background by attaching it to a sprite.

Member Enumeration Documentation

Enumerator
None 
Horizontal 
Vertical 
Both 
BasedOnHeight 
FillKeepingRatio 
FitInternalKeepingRatio 

Member Data Documentation

Vector2 UIStretch.borderPadding = Vector2.zero

Padding applied after the size of the stretched object gets calculated. This value is in pixels.

GameObject UIStretch.container = null

Object used to determine the container's bounds. Overwrites the camera-based anchoring if the value was specified.

Vector2 UIStretch.initialSize = Vector2.one

The size that the item/image should start out initially. Used for FillKeepingRatio, and FitInternalKeepingRatio. Contributed by Dylan Ryan.

Vector2 UIStretch.relativeSize = Vector2.one

Relative-to-target size.

bool UIStretch.runOnlyOnce = true

Whether the operation will occur only once and the script will then be disabled. Screen size changes will still cause the script's logic to execute.

Style UIStretch.style = Style.None

Stretching style.

Camera UIStretch.uiCamera = null

Camera used to determine the anchor bounds. Set automatically if none was specified.


The documentation for this class was generated from the following file: