class AnchorLayoutData
package feathers.layout
extends EventDispatcher
implements ILayoutData
Sets anchors on children of containers that use AnchorLayout
.
Events:
openfl.events.Event.CHANGE |
---|
1.0.0
.See also:
Static methods
staticbottomCenter(bottom:Float = 0.0, horizontalCenter:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that aligns the child to the bottom-center
edge of the parent container, with the ability to optionally specify
padding values to pass to bottom
and horizontalCenter
.
In the following example, one of the container's children is aligned to the container's bottom-center edge:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.bottomCenter();
container.addChild(child);
1.0.0
.See also:
staticbottomLeft(bottom:Float = 0.0, left:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that aligns the child to the bottom-left
corner of the parent container, with the ability to optionally specify
padding values to pass to bottom
and left
.
In the following example, one of the container's children is aligned to the container's bottom-left corner:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.bottomLeft();
container.addChild(child);
1.0.0
.See also:
staticbottomRight(bottom:Float = 0.0, right:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that aligns the child to the bottom-right
corner of the parent container, with the ability to optionally specify
padding values to pass to bottom
and right
.
In the following example, one of the container's children is aligned to the container's bottom-right corner:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.bottomRight();
container.addChild(child);
1.0.0
.See also:
staticcenter(x:Float = 0.0, y:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that centers the object both horizontally and
vertically, with the ability to optionally specify offsets in either
direction.
In the following example, one of the container's children is centered both horizontally and vertically within the container's bounds:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.center();
container.addChild(child);
1.0.0
.See also:
staticfill(padding:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that fills the parent container, with the
ability to optionally specify a padding value to pass to top
, right
,
bottom
, and left
.
In the following example, one of the container's children fills the container's bounds:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.fill();
container.addChild(child);
1.0.0
.See also:
staticfillHorizontal(padding:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that fills the width of the parent container,
with the ability to optionally specify a padding value to pass to
left
and right
.
In the following example, one of the container's children fills the container's width:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.fillHorizontal();
container.addChild(child);
1.0.0
.See also:
staticfillVertical(padding:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that height the width of the parent
container, with the ability to optionally specify a padding value to
pass to top
and bottom
.
In the following example, one of the container's children fills the container's height:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.fillHorizontal();
container.addChild(child);
1.0.0
.See also:
staticmiddleLeft(verticalCenter:Float = 0.0, left:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that aligns the child to the middle-edge
corner of the parent container, with the ability to optionally specify
padding values to pass to verticalCenter
and left
.
In the following example, one of the container's children is aligned to the container's middle-left edge:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.middleLeft();
container.addChild(child);
1.0.0
.See also:
staticmiddleRight(verticalCenter:Float = 0.0, right:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that aligns the child to the middle-right
edge of the parent container, with the ability to optionally specify
padding values to pass to verticalCenter
and right
.
In the following example, one of the container's children is aligned to the container's middle-right edge:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.middleRight();
container.addChild(child);
1.0.0
.See also:
statictopCenter(top:Float = 0.0, horizontalCenter:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that aligns the child to the top-center edge
of the parent container, with the ability to optionally specify padding
values to pass to top
and horizontalCenter
.
In the following example, one of the container's children is aligned to the container's top-center edge:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.topCenter();
container.addChild(child);
1.0.0
.See also:
statictopLeft(top:Float = 0.0, left:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that aligns the child to the top-left corner
of the parent container, with the ability to optionally specify padding
values to pass to top
and left
.
In the following example, one of the container's children is aligned to the container's top-left corner:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.topLeft();
container.addChild(child);
1.0.0
.See also:
statictopRight(top:Float = 0.0, right:Float = 0.0):AnchorLayoutData
Creates AnchorLayoutData
that aligns the child to the top-right corner
of the parent container, with the ability to optionally specify padding
values to pass to top
and right
.
In the following example, one of the container's children is aligned to the container's top-right corner:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var child = new Label();
child.layoutData = AnchorLayoutData.topRight();
container.addChild(child);
1.0.0
.See also:
Constructor
new(?top:AbstractAnchor, ?right:AbstractAnchor, ?bottom:AbstractAnchor, ?left:AbstractAnchor, ?horizontalCenter:Float, ?verticalCenter:Float)
Creates a new AnchorLayoutData
object from the given arguments.
1.0.0
.Variables
bottom:AbstractAnchor
The position, measured in pixels, of the object's bottom edge relative
to the bottom anchor, or, if there is no bottom anchor, then the
position is relative to the bottom edge of the parent container. If this
value is null
, the object's bottom edge will not be anchored.
In the following example, one of the container's children is anchored 10 pixels from the bottom edge of the container:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var anchors = new AnchorLayoutData();
anchors.bottom = 10.0;
var child = new Label();
child.layoutData = anchors;
container.addChild(child);
1.0.0
.horizontalCenter:Null<Float>
The position, measured in pixels, of the object's horizontal center
relative to the horizontal center anchor, or, if there is no horizontal
center anchor, then the position is relative to the horizontal center of
the parent container. If this value is null
, the object's horizontal
center will not be anchored.
In the following example, one of the container's children is centered horizontally within the container's bounds:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var anchors = new AnchorLayoutData();
anchors.horizontalCenter = 0.0;
var child = new Label();
child.layoutData = anchors;
container.addChild(child);
1.0.0
.left:AbstractAnchor
The position, measured in pixels, of the object's left edge relative to
the left anchor, or, if there is no left anchor, then the position is
relative to the left edge of the parent container. If this value is
null
, the object's left edge will not be anchored.
In the following example, one of the container's children is anchored 10 pixels from the left edge of the container:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var anchors = new AnchorLayoutData();
anchors.left = 10.0;
var child = new Label();
child.layoutData = anchors;
container.addChild(child);
1.0.0
.right:AbstractAnchor
The position, measured in pixels, of the object's right edge relative to
the right anchor, or, if there is no right anchor, then the position is
relative to the right edge of the parent container. If this value is
null
, the object's right edge will not be anchored.
In the following example, one of the container's children is anchored 10 pixels from the right edge of the container:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var anchors = new AnchorLayoutData();
anchors.right = 10.0;
var child = new Label();
child.layoutData = anchors;
container.addChild(child);
1.0.0
.top:AbstractAnchor
The position, measured in pixels, of the object's top edge relative to
the top anchor, or, if there is no top anchor, then the position is
relative to to the top edge of the parent container. If this value is
null
, the object's top edge will not be anchored.
In the following example, one of the container's children is anchored 10 pixels from the top edge of the container:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var anchors = new AnchorLayoutData();
anchors.top = 10.0;
var child = new Label();
child.layoutData = anchors;
container.addChild(child);
1.0.0
.verticalCenter:Null<Float>
The position, measured in pixels, of the object's vertical center
relative to the vertical center anchor, or, if there is no vertical
center anchor, then the position is relative to the vertical center of
the parent container. If this value is null
, the object's vertical
center will not be anchored.
In the following example, one of the container's children is centered vertically within the container's bounds:
var container = new LayoutGroup();
container.layout = new AnchorLayout();
var anchors = new AnchorLayoutData();
anchors.verticalCenter = 0.0;
var child = new Label();
child.layoutData = anchors;
container.addChild(child);
1.0.0
.