TiledColumnsLayout
public class
feathers.layout.TiledColumnsLayout
Description
Positions items as tiles (equal width and height) from top to bottom in multiple columns. Constrained to the suggested height, the tiled columns layout will change in width as the number of items increases or decreases.
See also:
http://wiki.starling-framework.org/feathers/tiled-columns-layout
API overview
Constructor
TiledColumnsLayout
()
Constructor.
Attributes
Public attributes
| gap: Number |
Quickly sets both |
| horizontalAlign: String |
If the total row width is less than the bounds, the items in the row can be aligned horizontally |
| horizontalGap: Number |
The horizontal space, in pixels, between tiles |
| 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 space, in pixels, below the items |
| paddingLeft: Number |
The space, in pixels, to the left of the items |
| paddingRight: Number |
The space, in pixels, to the right of the items |
| paddingTop: Number |
The space, in pixels, above of items |
| paging: String |
If the total combined width of the columns is larger than the width of the view port, the layout will be split into pages where each page is filled with the maximum number of columns that may be displayed without cutting off any items |
| tileHorizontalAlign: String |
If the item's width is less than the tile bounds, the position of the item can be aligned horizontally |
| tileVerticalAlign: String |
If an item's height is less than the tile bounds, the position of the item can be aligned vertically |
| typicalItemHeight: Number |
The height, in pixels, of a "typical" item that is used to virtually fill in blanks for the layout |
| typicalItemWidth: Number |
The width, in pixels, of a "typical" item that is used to virtually fill in blanks for the layout |
| useSquareTiles: Boolean |
Determines if the tiles must be square or if their width and height may have different values |
| useVirtualLayout: Boolean |
Determines if virtual layout can be used |
| verticalAlign: String |
If the total column height is less than the bounds, the items in the column can be aligned vertically |
| verticalGap: Number |
The vertical space, in pixels, between tiles |
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 |
| PAGING_HORIZONTAL: String |
static
The items will be positioned in pages horizontally from left to right |
| PAGING_NONE: String |
static
The items will not be paged |
| PAGING_VERTICAL: String |
static
The items will be positioned in pages vertically from top to bottom |
| TILE_HORIZONTAL_ALIGN_CENTER: String |
static
If an item width is smaller than the width of a tile, the item will be aligned to the center of the tile |
| TILE_HORIZONTAL_ALIGN_JUSTIFY: String |
static
The item will be resized to fit the width of the tile |
| TILE_HORIZONTAL_ALIGN_LEFT: String |
static
If an item width is smaller than the width of a tile, the item will be aligned to the left edge of the tile |
| TILE_HORIZONTAL_ALIGN_RIGHT: String |
static
If an item width is smaller than the width of a tile, the item will be aligned to the right edge of the tile |
| TILE_VERTICAL_ALIGN_BOTTOM: String |
static
If an item height is smaller than the height of a tile, the item will be aligned to the bottom edge of the tile |
| TILE_VERTICAL_ALIGN_JUSTIFY: String |
static
The item will be resized to fit the height of the tile |
| TILE_VERTICAL_ALIGN_MIDDLE: String |
static
If an item height is smaller than the height of a tile, the item will be aligned to the middle of the tile |
| TILE_VERTICAL_ALIGN_TOP: String |
static
If an item height is smaller than the height of a tile, the item will be aligned to the top edge of the tile |
| VERTICAL_ALIGN_BOTTOM: String |
static
If the total item height is smaller than the height of the bounds, the items will be aligned to the bottom |
| VERTICAL_ALIGN_MIDDLE: String |
static
If the total item height is smaller than the height of the bounds, the items will be aligned to the middle |
| VERTICAL_ALIGN_TOP: String |
static
If the total item height is smaller than the height of the bounds, the items will be aligned to the top |
Functions
Public functions
| 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> |
Determines which indices are visible with the specified view port bounds and scroll position |
| layout ( items: Vector.<DisplayObject> , viewPortBounds: ViewPortBounds = null , result: LayoutBoundsResult = null ): LayoutBoundsResult | |
| measureViewPort ( itemCount: Number , viewPortBounds: ViewPortBounds = null ): Point |
Using the typical item bounds and suggested bounds, returns a set of calculated dimensions for the view port |
Constructor
TiledColumnsLayout ()
Constructor.
Attributes
gap: Number
Quickly sets both horizontalGap and verticalGap
to the same value. The gap getter always returns the
value of verticalGap, but the value of
horizontalGap may be different.
horizontalAlign: String
If the total row width is less than the bounds, the items in the row 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.
paging: String
If the total combined width of the columns is larger than the width of the view port, the layout will be split into pages where each page is filled with the maximum number of columns that may be displayed without cutting off any items.
tileHorizontalAlign: String
If the item's width is less than the tile bounds, the position of the item can be aligned horizontally.
tileVerticalAlign: String
If an item's height is less than the tile bounds, the position of the item can be aligned vertically.
typicalItemHeight: Number
The height, in pixels, of a "typical" item that is used to virtually
fill in blanks for the layout. This value is usually set by a
component that is using the layout, such as a List. For
instance, the List class provides a typicalItem
property that will be used to calculate this value. If you set
typicalItemHeight manually, your value will be completely
replaced by the value calculated by the List. In other
words, you should use that typicalItem property instead.
typicalItemWidth: Number
The width, in pixels, of a "typical" item that is used to virtually
fill in blanks for the layout. This value is meant to be set by a
component that is using the layout, such as a List. For
instance, the List class provides a typicalItem
property that will be used to calculate this value. If you set
typicalItemWidth manually, your value will be completely
replaced by the value calculated by the List. In other
words, you should use that typicalItem property instead.
useSquareTiles: Boolean
Determines if the tiles must be square or if their width and height may have different values.
useVirtualLayout: Boolean
Determines if virtual layout can be used. Some components don't support virtual layouts. In those cases, the virtual layout options will be ignored.
verticalAlign: String
If the total column height is less than the bounds, the items in the column can be aligned vertically.
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.
PAGING_HORIZONTAL: String
static
The items will be positioned in pages horizontally from left to right.
PAGING_NONE: String
static
The items will not be paged. In other words, they will be positioned in a continuous set of columns without gaps.
TILE_HORIZONTAL_ALIGN_CENTER: String
static
If an item width is smaller than the width of a tile, the item will be aligned to the center of the tile.
TILE_HORIZONTAL_ALIGN_LEFT: String
static
If an item width is smaller than the width of a tile, the item will be aligned to the left edge of the tile.
TILE_HORIZONTAL_ALIGN_RIGHT: String
static
If an item width is smaller than the width of a tile, the item will be aligned to the right edge of the tile.
TILE_VERTICAL_ALIGN_BOTTOM: String
static
If an item height is smaller than the height of a tile, the item will be aligned to the bottom edge of the tile.
TILE_VERTICAL_ALIGN_MIDDLE: String
static
If an item height is smaller than the height of a tile, the item will be aligned to the middle of the tile.
TILE_VERTICAL_ALIGN_TOP: String
static
If an item height is smaller than the height of a tile, the item will be aligned to the top edge of the tile.
VERTICAL_ALIGN_BOTTOM: String
static
If the total item height is smaller than the height of the bounds, the items will be aligned to the bottom.
VERTICAL_ALIGN_MIDDLE: String
static
If the total item height is smaller than the height of the bounds, the items will be aligned to the middle.
VERTICAL_ALIGN_TOP: String
static
If the total item height is smaller than the height of the bounds, the items will be aligned to the top.
Functions
addEventListener
(
type: String
,
listener: Function
): Void
Inherited from EventDispatcher
Registers an event listener at a certain object.
Parameters
| type: String | |
| listener: Function |
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>
Determines which indices are visible with the specified view port bounds and scroll position. Indices that aren't returned are typically not displayed and can be replaced virtually.
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
Using the typical item bounds and suggested bounds, returns a set of calculated dimensions for the view port.
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 |