Provides optional percentage sizing for children of containers that use HorizontalLayout.

Events:

openfl.events.Event.CHANGE
Available since

1.0.0

.

See also:

Constructor

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

Creates a new HorizontalLayoutData object from the given arguments.

Available since

1.0.0

.

Variables

@:flash.propertypercentHeight:Null<Float>

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

.

@:flash.propertypercentWidth:Null<Float>

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

.