Extra, optional data used by a HorizontalLayout instance to position and size a display object.

Available since

1.0.0

.

See:

Constructor

new (?percentWidth:Float, ?percentHeight:Float)

Creates a new HorizontalLayoutData object from the given arguments.

Available since

1.0.0

.

Variables

@:value(null)percentHeight:Null<Float> = null

The height of the layout object, as a percentage of the parent container's height.

A percentage may be specified in the range from 0.0 to 100.0. If the value is set to null, this property is ignored.

In the following example, the height of a container's child is set to 50% of the container's height:

var container = new LayoutGroup();
container.layout = new HorizontalLayout();

var percentages = new HorizontalLayoutData();
percentages.percentHeight = 50.0;

var child = new Label();
child.layoutData = percentages;
container.addChild(child);
Available since

1.0.0

.

@:value(null)percentWidth:Null<Float> = null

The width of the layout object, as a percentage of the parent container's width. The parent container will calculate the sum of all of its children with explicit pixel widths, and then the remaining space will be distributed to children with percent widths.

A percentage may be specified in the range from 0.0 to 100.0. If the value is set to null, this property is ignored.

In the following example, the width of a container's child is set to 50% of the container's width:

var container = new LayoutGroup();
container.layout = new HorizontalLayout();

var percentages = new HorizontalLayoutData();
percentages.percentWidth = 50.0;

var child = new Label();
child.layoutData = percentages;
container.addChild(child);
Available since

1.0.0

.