HorizontalLayout
public class
feathers.layout.HorizontalLayout
Description
Positions items from left to right in a single row.
See also:
http://wiki.starling-framework.org/feathers/horizontal-layout
API overview
Constructor
HorizontalLayout
()
Constructor.
Attributes
Public attributes
| afterVirtualizedItemCount: Number |
The number of virtualized items that appear after the items passed
to |
| beforeVirtualizedItemCount: Number |
The number of virtualized items that appear before the items passed
to |
| gap: Number |
The space, in pixels, between items |
| hasVariableItemDimensions: Boolean |
When the layout is virtualized, and this value is true, the items may have variable dimensions |
| horizontalAlign: String |
If the total item width is less than the bounds, the positions of the items can be aligned horizontally |
| manageVisibility: Boolean |
Determines if items will be set invisible if they are outside the view port |
| padding: Number |
Quickly sets all padding properties to the same value |
| paddingBottom: Number |
The minimum space, in pixels, above the items |
| paddingLeft: Number |
The space, in pixels, before the first item |
| paddingRight: Number |
The space, in pixels, after the last item |
| paddingTop: Number |
The minimum space, in pixels, above the items |
| scrollPositionHorizontalAlign: String |
When the scroll position is calculated for an item, an attempt will be made to align the item to this position |
| typicalItemHeight: Number | |
| typicalItemWidth: Number | |
| useVirtualLayout: Boolean | |
| verticalAlign: String |
The alignment of the items vertically, on the y-axis |
Constants
Constants
| HORIZONTAL_ALIGN_CENTER: String |
static
If the total item width is smaller than the width of the bounds, the items will be aligned to the center |
| HORIZONTAL_ALIGN_LEFT: String |
static
If the total item width is smaller than the width of the bounds, the items will be aligned to the left |
| HORIZONTAL_ALIGN_RIGHT: String |
static
If the total item width is smaller than the width of the bounds, the items will be aligned to the right |
| VERTICAL_ALIGN_BOTTOM: String |
static
The items will be aligned to the bottom of the bounds |
| VERTICAL_ALIGN_JUSTIFY: String |
static
The items will fill the height of the bounds |
| VERTICAL_ALIGN_MIDDLE: String |
static
The items will be aligned to the middle of the bounds |
| VERTICAL_ALIGN_TOP: String |
static
The items will be aligned to the top of the bounds |
Functions
Public functions
| addToVariableVirtualCacheAtIndex ( index: Number , item: DisplayObject = null ): Void |
Inserts an item in to the cache at the specified index, pushing the old cached value at that index, and all following values, up one index |
| getScrollPositionForIndex ( index: Number , items: Vector.<DisplayObject> , x: Number , y: Number , width: Number , height: Number ): Point | |
| getVisibleIndicesAtScrollPosition ( scrollX: Number , scrollY: Number , width: Number , height: Number , itemCount: Number , result: Vector.<Number> = null ): Vector.<Number> | |
| layout ( items: Vector.<DisplayObject> , viewPortBounds: ViewPortBounds = null , result: LayoutBoundsResult = null ): LayoutBoundsResult | |
| measureViewPort ( itemCount: Number , viewPortBounds: ViewPortBounds = null ): Point | |
| removeFromVariableVirtualCacheAtIndex ( index: Number ): Void |
Removes an item in to the cache at the specified index, moving the values at following indexes down by one |
| resetVariableVirtualCache (): Void |
Clears the cached dimensions for all virtualized indices |
| resetVariableVirtualCacheAtIndex ( index: Number , item: DisplayObject = null ): Void |
Clears the cached dimensions for one specific virtualized index |
Constructor
HorizontalLayout ()
Constructor.
Attributes
afterVirtualizedItemCount: Number
The number of virtualized items that appear after the items passed
to layout(). Allows the array of items to be smaller
than the full size. Does not work if the layout has variable item
dimensions.
beforeVirtualizedItemCount: Number
The number of virtualized items that appear before the items passed
to layout(). Allows the array of items to be smaller
than the full size. Does not work if the layout has variable item
dimensions.
hasVariableItemDimensions: Boolean
When the layout is virtualized, and this value is true, the items may have variable dimensions. If false, the items will all share the same dimensions as the typical item. Performance is better for layouts where all items have the same dimensions.
horizontalAlign: String
If the total item width is less than the bounds, the positions of the items can be aligned horizontally.
manageVisibility: Boolean
Determines if items will be set invisible if they are outside the
view port. Can improve performance, especially for non-virtual
layouts. If true, you will not be able to manually
change the visible property of any items in the layout.
padding: Number
Quickly sets all padding properties to the same value. The
padding getter always returns the value of
paddingTop, but the other padding values may be
different.
scrollPositionHorizontalAlign: String
When the scroll position is calculated for an item, an attempt will be made to align the item to this position.
typicalItemHeight: Number
typicalItemWidth: Number
useVirtualLayout: Boolean
Constants
HORIZONTAL_ALIGN_CENTER: String
static
If the total item width is smaller than the width of the bounds, the items will be aligned to the center.
HORIZONTAL_ALIGN_LEFT: String
static
If the total item width is smaller than the width of the bounds, the items will be aligned to the left.
HORIZONTAL_ALIGN_RIGHT: String
static
If the total item width is smaller than the width of the bounds, the items will be aligned to the right.
Functions
addEventListener
(
type: String
,
listener: Function
): Void
Inherited from EventDispatcher
Registers an event listener at a certain object.
Parameters
| type: String | |
| listener: Function |
addToVariableVirtualCacheAtIndex ( index: Number , item: DisplayObject = null ): Void
Inserts an item in to the cache at the specified index, pushing the old cached value at that index, and all following values, up one index.
Parameters
| index: Number | |
| item: DisplayObject = null |
dispatchEvent
(
event: Event
): Void
Inherited from EventDispatcher
Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.
Parameters
| event: Event |
dispatchEventWith
(
type: String
,
bubbles: Boolean
= false
,
data: Object
= null
): Void
Inherited from EventDispatcher
Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.
Parameters
| type: String | |
| bubbles: Boolean = false | |
| data: Object = null |
getFullTypeName
(): String
Inherited from Object
native
Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.
Returns
| String | fully qualified type name of the Object. |
getScrollPositionForIndex ( index: Number , items: Vector.<DisplayObject> , x: Number , y: Number , width: Number , height: Number ): Point
Parameters
| index: Number | |
| items: Vector.<DisplayObject> | |
| x: Number | |
| y: Number | |
| width: Number | |
| height: Number |
getType
(): Type
Inherited from Object
native
Gets the Type that describes the Object.
Returns
| Type | The Type that describes the object. |
getTypeName
(): String
Inherited from Object
native
Gets the type name of the Object.
Returns
| String | type name of the Object. |
getVisibleIndicesAtScrollPosition ( scrollX: Number , scrollY: Number , width: Number , height: Number , itemCount: Number , result: Vector.<Number> = null ): Vector.<Number>
Parameters
| scrollX: Number | |
| scrollY: Number | |
| width: Number | |
| height: Number | |
| itemCount: Number | |
| result: Vector.<Number> = null |
hasEventListener
(
type: String
): Boolean
Inherited from EventDispatcher
Returns if there are listeners registered for a certain event type.
Parameters
| type: String |
layout ( items: Vector.<DisplayObject> , viewPortBounds: ViewPortBounds = null , result: LayoutBoundsResult = null ): LayoutBoundsResult
Parameters
| items: Vector.<DisplayObject> | |
| viewPortBounds: ViewPortBounds = null | |
| result: LayoutBoundsResult = null |
measureViewPort ( itemCount: Number , viewPortBounds: ViewPortBounds = null ): Point
Parameters
| itemCount: Number | |
| viewPortBounds: ViewPortBounds = null |
removeEventListener
(
type: String
,
listener: Function
): Void
Inherited from EventDispatcher
Removes an event listener from the object.
Parameters
| type: String | |
| listener: Function |
removeEventListeners
(
type: String
= null
): Void
Inherited from EventDispatcher
Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.
Parameters
| type: String = null |
removeFromVariableVirtualCacheAtIndex ( index: Number ): Void
Removes an item in to the cache at the specified index, moving the values at following indexes down by one.
Parameters
| index: Number |
resetVariableVirtualCacheAtIndex ( index: Number , item: DisplayObject = null ): Void
Clears the cached dimensions for one specific virtualized index.
Parameters
| index: Number | |
| item: DisplayObject = null |