| Package | com.soma.ui.layouts |
| Class | public class HBoxUI |
| Inheritance | HBoxUI LayoutUI flash.display.MovieClip |
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 | |
| childrenAlign : String
Property to set the start position and direction of the alignment of the DisplayObject children in the layout. | HBoxUI | ||
| childrenEnable : Boolean
Indicates wether or not the layout will calculate the size and position of the DisplayObject children
| HBoxUI | ||
| childrenGap : GapUI
GapUI instance (Value Object) that contains the necessary properties to set the gap value between the DisplayObject children in the layout (horizontal, vertical). | HBoxUI | ||
| childrenPadding : PaddingUI
PaddingUI instance (Value Object) that contains the necessary properties to set the padding value in the layout (left, right, top, bottom). | HBoxUI | ||
![]() | 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 | ||
|---|---|---|---|
HBoxUI(reference:DisplayObjectContainer, width:Number = 100, height:Number = 100)
Create a HBoxUI instance
| HBoxUI | ||
dispose():void [override]
Destroys the instance so it can be garbage collected. | HBoxUI | ||
![]() | 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 | |
| Constant | Defined By | ||
|---|---|---|---|
| ALIGN_BOTTOM_LEFT : String = bottom_left [static] static constant for the children alignment in the layout (property childrenAlign) | HBoxUI | ||
| ALIGN_BOTTOM_RIGHT : String = bottom_right [static] static constant for the children alignment in the layout (property childrenAlign) | HBoxUI | ||
| ALIGN_CENTER_LEFT : String = center_left [static] static constant for the children alignment in the layout (property childrenAlign) | HBoxUI | ||
| ALIGN_CENTER_RIGHT : String = center_right [static] static constant for the children alignment in the layout (property childrenAlign) | HBoxUI | ||
| ALIGN_TOP_LEFT : String = top_left [static] static constant for the children alignment in the layout (property childrenAlign) | HBoxUI | ||
| ALIGN_TOP_RIGHT : String = top_right [static] static constant for the children alignment in the layout (property childrenAlign) | HBoxUI | ||
| childrenAlign | property |
childrenAlign:StringProperty to set the start position and direction of the alignment of the DisplayObject children in the layout. The value can be HBoxUI.ALIGN_TOP_LEFT, HBoxUI.ALIGN_CENTER_LEFT, HBoxUI.ALIGN_BOTTOM_LEFT, HBoxUI.ALIGN_TOP_RIGHT, HBoxUI.ALIGN_CENTER_RIGHT and HBoxUI.ALIGN_BOTTOM_RIGHT.
public function get childrenAlign():String public function set childrenAlign(value:String):void| childrenEnable | property |
childrenEnable:BooleanIndicates wether or not the layout will calculate the size and position of the DisplayObject children
The default value is true.
public function get childrenEnable():Boolean public function set childrenEnable(value:Boolean):void| childrenGap | property |
childrenGap:GapUIGapUI instance (Value Object) that contains the necessary properties to set the gap value between the DisplayObject children in the layout (horizontal, vertical). The gap is the distance between each one of the DisplayObject children, horizontally and vertically.
public function get childrenGap():GapUI public function set childrenGap(value:GapUI):voidSee also
| childrenPadding | property |
childrenPadding:PaddingUIPaddingUI instance (Value Object) that contains the necessary properties to set the padding value in the layout (left, right, top, bottom). The padding is the distance between the DisplayObject children and the borders of the layout
public function get childrenPadding():PaddingUI public function set childrenPadding(value:PaddingUI):voidSee also
| HBoxUI | () | Constructor |
public function HBoxUI(reference:DisplayObjectContainer, width:Number = 100, height:Number = 100)Create a HBoxUI 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 |
override public function dispose():voidDestroys the instance so it can be garbage collected. Automatically called when you remove an object from the BaseUI instance.
| ALIGN_BOTTOM_LEFT | Constant |
public static const ALIGN_BOTTOM_LEFT:String = bottom_leftstatic constant for the children alignment in the layout (property childrenAlign)
| ALIGN_BOTTOM_RIGHT | Constant |
public static const ALIGN_BOTTOM_RIGHT:String = bottom_rightstatic constant for the children alignment in the layout (property childrenAlign)
| ALIGN_CENTER_LEFT | Constant |
public static const ALIGN_CENTER_LEFT:String = center_leftstatic constant for the children alignment in the layout (property childrenAlign)
| ALIGN_CENTER_RIGHT | Constant |
public static const ALIGN_CENTER_RIGHT:String = center_rightstatic constant for the children alignment in the layout (property childrenAlign)
| ALIGN_TOP_LEFT | Constant |
public static const ALIGN_TOP_LEFT:String = top_leftstatic constant for the children alignment in the layout (property childrenAlign)
| ALIGN_TOP_RIGHT | Constant |
public static const ALIGN_TOP_RIGHT:String = top_rightstatic constant for the children alignment in the layout (property childrenAlign)
var hbox:HBoxUI = new HBoxUI(stage, 400, 300);
hbox.backgroundColor = 0xFF0000;
hbox.backgroundAlpha = 0.2;
hbox.ratio = ElementUI.RATIO_IN;
hbox.childrenGap = new GapUI(5, 5);
hbox.childrenPadding = new PaddingUI(5, 5, 5, 5);
hbox.childrenAlign = HBoxUI.ALIGN_BOTTOM_RIGHT;
addChild(hbox);
for (var i:int=0; i<8; ++i) {
var sprite:Sprite = new Sprite();
sprite.graphics.beginFill(0xFF0000, .5);
sprite.graphics.drawRect(0, 0, 100, 100);
hbox.addChild(sprite);
}
hbox.refresh();