class TiledRowsLayout
package feathers.layout
extends EventDispatcher
implements IDragDropLayout, ILayout
Positions items as tiles (all items have equal dimensions) in one or more rows.
Events:
openfl.events.Event.CHANGE | Dispatched when a property of the layout changes, which triggers the container to invalidate. |
---|
1.0.0
.See also:
Constructor
Variables
alignEmptyHorizontalTiles:Bool
Indicates if empty tiles should be included when positioning items with
the horizontalAlign
property. For instance, if the
requestedColumnCount
is 3
, but the total number of tiles in a row is
2
, that row can be aligned as if it contained all 3
items.
1.0.0
.See also:
horizontalAlign:HorizontalAlign
How each row is positioned horizontally (along the x-axis) within the container.
Note: The HorizontalAlign.JUSTIFY
constant is not supported by
this layout.
The following example aligns each row's content to the right:
layout.horizontalAlign = RIGHT;
1.0.0
.See also:
horizontalGap:Float
The horizontal space, in pixels, between each two adjacent items in the layout.
If the horizontalGap
is set to Math.POSITIVE_INFINITY
, the items
will be positioned as far apart as possible. In this case, the
horizontal gap will never be smaller than minHorizontalGap
.
In the following example, the layout's horizontal gap is set to 20 pixels:
layout.horizontalGap = 20.0;
1.0.0
.minHorizontalGap:Float
If the value of the horizontalGap
property is
Math.POSITIVE_INFINITY
, meaning that the gap will fill as much space
as possible and position the items as far from each other as they can go
without going outside of the view port bounds, the final calculated
value of the horizontal gap will not be smaller than the value of the
minHorizontalGap
property.
In the following example, the layout's horizontal gap is set to 4 pixels:
layout.minHorizontalGap = 4.0;
1.0.0
.minVerticalGap:Float
If the value of the verticalGap
property is
Math.POSITIVE_INFINITY
, meaning that the gap will fill as much space
as possible and position the items as far from each other as they can go
without going outside of the view port bounds, the final calculated
value of the vertical gap will not be smaller than the value of the
minVerticalGap
property.
In the following example, the layout's vertical gap is set to 4 pixels:
layout.minVerticalGap = 4.0;
1.0.0
.paddingBottom:Float
The space, in pixels, between the parent container's bottom edge and its content.
In the following example, the layout's bottom padding is set to 20 pixels:
layout.paddingBottom = 20.0;
1.0.0
.paddingLeft:Float
The space, in pixels, between the parent container's left edge and its content.
In the following example, the layout's left padding is set to 20 pixels:
layout.paddingLeft = 20.0;
1.0.0
.paddingRight:Float
The space, in pixels, between the parent container's right edge and its content.
In the following example, the layout's right padding is set to 20 pixels:
layout.paddingRight = 20.0;
1.0.0
.paddingTop:Float
The space, in pixels, between the parent container's top edge and its content.
In the following example, the layout's top padding is set to 20 pixels:
layout.paddingTop = 20.0;
1.0.0
.requestedColumnCount:Null<Int>
The exact number of columns to render, if space allows. If set to
null
, the number of columns will be the total number of items that can
be displayed within the container's width.
In the following example, the layout's requested column count is set to 2 items:
layout.requestedColumnCount = 2;
1.0.0
.See also:
requestedMaxColumnCount:Null<Int>
The maximum number of columns to render, if space allows. If set to
null
, the maximum number of columns will be the total number of items
that can be displayed within the container's width.
If requestedColumnCount
is also set, this property is ignored.
In the following example, the layout's requested maximum column count is set to 5 items:
layout.requestedMaxColumnCount = 5.0;
1.0.0
.See also:
requestedMinColumnCount:Null<Int>
The minimum number of columns to render, if space allows. If set to
null
, the minimum number of columns will be 1.
If requestedColumnCount
is also set, this property is ignored.
In the following example, the layout's requested minimum column count is set to 3 items:
layout.requestedMinColumnCount = 3;
1.0.0
.See also:
verticalAlign:VerticalAlign
How the content is positioned vertically (along the y-axis) within the container. If the total height of the content is larger than the available height within the container, then the positioning of the items will always start from the top.
Note: The VerticalAlign.JUSTIFY
constant is not supported by this
layout.
The following example aligns the container's content to the bottom:
layout.verticalAlign = BOTTOM;
1.0.0
.See also:
verticalGap:Float
The vertical space, in pixels, between each two adjacent items in the layout.
If the verticalGap
is set to Math.POSITIVE_INFINITY
, the items
will be positioned as far apart as possible. In this case, the
vertical gap will never be smaller than minVerticalGap
.
In the following example, the layout's vertical gap is set to 20 pixels:
layout.verticalGap = 20.0;
1.0.0
.Methods
getDragDropIndex(items:Array<DisplayObject>, x:Float, y:Float, width:Float, height:Float):Int
getDragDropRegion(items:Array<DisplayObject>, dropIndex:Int, x:Float, y:Float, width:Float, height:Float, ?result:Rectangle):Rectangle
layout(items:Array<DisplayObject>, measurements:Measurements, ?result:LayoutBoundsResult):LayoutBoundsResult
See also:
setGap(value:Float):Void
Sets both horizontal and vertical gap properties to the same value.
1.0.0
.See also:
setPadding(value:Float):Void
Sets all four padding properties to the same value.
1.0.0
.See also: