Sets anchors on children of containers that use AnchorLayout.

Events:

openfl.events.Event.CHANGE

Dispatched when a property of the layout data changes, which triggers the container to invalidate.

Available since

1.0.0

.

See also:

Static methods

@:value({ horizontalCenter : 0.0, bottom : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ left : 0.0, bottom : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ right : 0.0, bottom : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ y : 0.0, x : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ padding : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ padding : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ padding : 0.0 })staticfillVertical(padding:Float = 0.0):AnchorLayoutData

Creates AnchorLayoutData that fills the height 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);
Available since

1.0.0

.

See also:

@:value({ left : 0.0, verticalCenter : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ right : 0.0, verticalCenter : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ horizontalCenter : 0.0, top : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ left : 0.0, top : 0.0 })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);
Available since

1.0.0

.

See also:

@:value({ right : 0.0, top : 0.0 })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);
Available since

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.

Available since

1.0.0

.

Variables

@:bindable("change")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);
Available since

1.0.0

.

@:bindable("change")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);
Available since

1.0.0

.

@:bindable("change")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);
Available since

1.0.0

.

@:bindable("change")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);
Available since

1.0.0

.

@:bindable("change")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);
Available since

1.0.0

.

@:bindable("change")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);
Available since

1.0.0

.