-
Notifications
You must be signed in to change notification settings - Fork 25
Stretch
Jeppe Zapp edited this page Feb 13, 2014
·
3 revisions
Stretch defines the width and height of widgets relatively to screen size
Variable | Type | |
---|---|---|
width | ScreenSize |
Width |
widthFactor | float |
Factor with which to multiply the width |
widthOffset | float |
Offset to modify width |
height | ScreenSize |
Height |
heightFactor | float |
Factor with which to multiply the height |
heightOffset | float |
Offset to modify height |
// UnityScript
var btn : OGButton;
function Start () {
// This widget should be to the half as wide as the screen - 40 pixels
btn.stretch.width = ScreenSize.ScreenWidth;
btn.stretch.widthOffset = -40;
btn.stretch.widthFactor = 0.5;
}
// C#
OGButton btn;
void Start () {
// This widget should be to the half as wide as the screen - 40 pixels
btn.stretch.width = ScreenSize.ScreenWidth;
btn.stretch.widthOffset = -40;
btn.stretch.widthFactor = 0.5;
}