| Package | com.soma.ui.layouts |
| Class | public class LayoutUI |
| Inheritance | LayoutUI flash.display.MovieClip |
| Subclasses | CanvasUI, HBoxUI, TileUI, VBoxUI |
See also
| Property | Defined By | ||
|---|---|---|---|
| alignX : String
Horizontal alignment used when the property ratio is set to ElementUI.RATIO_IN or ElementUI.RATIO_OUT, the value cn be ElementUI.ALIGN_LEFT, ElementUI.ALIGN_RIGHT, ElementUI.ALIGN_CENTER (X axis)
| LayoutUI | ||
| alignY : String
Vertical alignment used when the property ratio is set to ElementUI.RATIO_IN or ElementUI.RATIO_OUT, the value can be ElementUI.ALIGN_CENTER, ElementUI.ALIGN_TOP, ElementUI.ALIGN_BOTTOM (Y axis)
| LayoutUI | ||
| backgroundAlpha : Number
Transparency of the layout instance background (alpha)
| LayoutUI | ||
| backgroundColor : uint
Background color of the layout instance
| LayoutUI | ||
| bottom : Number
Distance from the bottom of the reference to the bottom of the layout instance (Y axis)
| LayoutUI | ||
| element : ElementUI [read-only]
ElementUI class internally used, it manages the directly accessible layout properties such as top, bottom, ratio, etc. | LayoutUI | ||
| enable : Boolean
Indicates wether or not the ElementUI instance will calculate and update the position and size of the layout instance
| LayoutUI | ||
| hideOutsideContent : Boolean
Hide the area of the DisplayObject children that are outside the boundaries (width and height)
| LayoutUI | ||
| horizontalCenter : Number
Distance from the middle of the reference to the middle of the layout instance (X axis)
| LayoutUI | ||
| left : Number
Distance from the left of the reference to the left of the layout instance (X axis)
| LayoutUI | ||
| ratio : String
The ratio is a mode used to make the layout instance fits an area and never get deformed (such as backgrounds for example). | LayoutUI | ||
| reference : DisplayObjectContainer
Reference used to calculate the position and size of the layout instance
| LayoutUI | ||
| right : Number
Distance from the right of the reference to the right of the layout instance (X axis)
| LayoutUI | ||
| rounded : Boolean
Indicates wether or not the position and size numbers of the layout instance are rounded to the nearest integer
| LayoutUI | ||
| top : Number
Distance from the top of the reference to the top of the layout instance (Y axis)
| LayoutUI | ||
| verticalCenter : Number
Distance from the middle of the reference to the middle of the layout instance (Y axis)
| LayoutUI | ||
| Method | Defined By | ||
|---|---|---|---|
LayoutUI(reference:DisplayObjectContainer, width:Number = 100, height:Number = 100)
Create a LayoutUI instance
| LayoutUI | ||
dispose():void
Destroys the instance so it can be garbage collected. | LayoutUI | ||
getRealHeight():Number
Get the real height of the layout
| LayoutUI | ||
getRealWidth():Number
Get the real width of the layout
| LayoutUI | ||
refresh():void
Calculate and update the position and size of the layout
| LayoutUI | ||
reset():void
Re-set all the ElementUI instance properties of the layout to initial values (NaN for numbers, and center for alignment)
| LayoutUI | ||
| alignX | property |
alignX:StringHorizontal alignment used when the property ratio is set to ElementUI.RATIO_IN or ElementUI.RATIO_OUT, the value cn be ElementUI.ALIGN_LEFT, ElementUI.ALIGN_RIGHT, ElementUI.ALIGN_CENTER (X axis)
public function get alignX():String public function set alignX(value:String):voidSee also
| alignY | property |
alignY:StringVertical alignment used when the property ratio is set to ElementUI.RATIO_IN or ElementUI.RATIO_OUT, the value can be ElementUI.ALIGN_CENTER, ElementUI.ALIGN_TOP, ElementUI.ALIGN_BOTTOM (Y axis)
public function get alignY():String public function set alignY(value:String):voidSee also
| backgroundAlpha | property |
backgroundAlpha:NumberTransparency of the layout instance background (alpha)
The default value is 0;.
public function get backgroundAlpha():Number public function set backgroundAlpha(value:Number):void| backgroundColor | property |
backgroundColor:uintBackground color of the layout instance
The default value is 0x000000;.
public function get backgroundColor():uint public function set backgroundColor(value:uint):void| bottom | property |
bottom:NumberDistance from the bottom of the reference to the bottom of the layout instance (Y axis)
public function get bottom():Number public function set bottom(value:Number):voidSee also
| element | property |
element:ElementUI [read-only] ElementUI class internally used, it manages the directly accessible layout properties such as top, bottom, ratio, etc. The EventUI listeners must be added to it.
public function get element():ElementUI| enable | property |
enable:BooleanIndicates wether or not the ElementUI instance will calculate and update the position and size of the layout instance
The default value is true.
public function get enable():Boolean public function set enable(value:Boolean):voidSee also
| hideOutsideContent | property |
hideOutsideContent:BooleanHide the area of the DisplayObject children that are outside the boundaries (width and height)
The default value is false;.
public function get hideOutsideContent():Boolean public function set hideOutsideContent(value:Boolean):void| horizontalCenter | property |
horizontalCenter:NumberDistance from the middle of the reference to the middle of the layout instance (X axis)
public function get horizontalCenter():Number public function set horizontalCenter(value:Number):voidSee also
| left | property |
left:NumberDistance from the left of the reference to the left of the layout instance (X axis)
public function get left():Number public function set left(value:Number):voidSee also
| ratio | property |
ratio:StringThe ratio is a mode used to make the layout instance fits an area and never get deformed (such as backgrounds for example). The type of ratio of the ElementUI can be ElementUI.RATIO_IN or ElementUI.RATIO_OUT, any other value will set the ratio to null (default). In the mode ElementUI.RATIO_IN, all the layout instance will be visible (related to the reference). In the mode ElementUI.RATIO_OUT, all the surface of the reference will be covered by the layout instance. The following properties can not be set or are not used when a ratio has been specified: x, y, width, height. The following properties can be used to "offset" the layout instance: horizontalCenter and verticalCenter.
The default value is null.
public function get ratio():String public function set ratio(value:String):voidSee also
| reference | property |
reference:DisplayObjectContainerReference used to calculate the position and size of the layout instance
public function get reference():DisplayObjectContainer public function set reference(value:DisplayObjectContainer):voidSee also
| right | property |
right:NumberDistance from the right of the reference to the right of the layout instance (X axis)
public function get right():Number public function set right(value:Number):voidSee also
| rounded | property |
rounded:BooleanIndicates wether or not the position and size numbers of the layout instance are rounded to the nearest integer
The default value is false.
public function get rounded():Boolean public function set rounded(value:Boolean):voidSee also
| top | property |
top:NumberDistance from the top of the reference to the top of the layout instance (Y axis)
public function get top():Number public function set top(value:Number):voidSee also
| verticalCenter | property |
verticalCenter:NumberDistance from the middle of the reference to the middle of the layout instance (Y axis)
public function get verticalCenter():Number public function set verticalCenter(value:Number):voidSee also
| LayoutUI | () | Constructor |
public function LayoutUI(reference:DisplayObjectContainer, width:Number = 100, height:Number = 100)Create a LayoutUI instance
Parametersreference:DisplayObjectContainer — DisplayObjectContainer instance used to calculate the size and position of the layout instance
| |
width:Number (default = 100) — width of the layout (not disturbed by children)
| |
height:Number (default = 100) — height of the layout (not disturbed by children)
|
See also
| dispose | () | method |
public function dispose():voidDestroys the instance so it can be garbage collected. Automatically called when you remove an object from the BaseUI instance.
See also
| getRealHeight | () | method |
public function getRealHeight():NumberGet the real height of the layout
ReturnsNumber — A Number
|
| getRealWidth | () | method |
public function getRealWidth():NumberGet the real width of the layout
ReturnsNumber — A Number
|
| refresh | () | method |
public function refresh():voidCalculate and update the position and size of the layout
See also
| reset | () | method |
public function reset():voidRe-set all the ElementUI instance properties of the layout to initial values (NaN for numbers, and center for alignment)
See also
var layout:LayoutUI = new LayoutUI(stage, 400, 300);
layout.backgroundColor = 0xFF0000;
layout.backgroundAlpha = 0.2;
layout.ratio = ElementUI.RATIO_IN;
layout.refresh();
addChild(layout);