Skip to main content

Position

The CSML language provides many different attributes for positioning.

From the center​

AttributeTypeDefaultDescription
horizontalCenterINTEGERWhen set, if left or right is not set, the layout will be centered horizontally offset by the numeric value of this property
percentHorizontalCenterINTEGERWhen set, if left or right is not set, the layout will be centered horizontally offset by the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%
minHorizontalCenterINTEGERThe minimum horizontal center location that can be applied through percentHorizontalCenter
maxHorizontalCenterINTEGERThe maximum horizontal center location that can be applied through percentHorizontalCenter
verticalCenterINTEGERWhen set, if top or bottom is not set, the layout will be centered vertically offset by the numeric value of this property
percentVerticalCenterINTEGERWhen set, if top or bottom is not set, the layout will be centered vertically offset by the value of this multiplied by to the containing height. A value of 0 represents 0% and 1 represents 100%
minVerticalCenterINTEGERThe minimum vertical center location that can be applied through percentVerticalCenter
maxVerticalCenterINTEGERThe maximum vertical center location that can be applied through percentVerticalCenter

From the top​

AttributeTypeDefaultDescription
topINTEGERWhen set, the top of the layout will be located offset from the top of its container by the value of this property
percentTopINTEGERWhen set, the top of the layout will be located offset by the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%
offsetTopINTEGERAdd additional offset to be added to the top value after it has been set
minTopINTEGERThe minimum top location that can be applied to the layout boundaries
maxTopINTEGERThe maximum top location that can be applied to the layout boundaries

From the bottom​

AttributeTypeDefaultDescription
bottomINTEGERWhen set, the bottom of the layout will be located offset from the bottom of its container by the value of this property
percentBottomINTEGERWhen set, the bottom of the layout will be located offset by the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%
offsetBottomINTEGERAdd additional offset to be added to the bottom value after it has been set
minBottomINTEGERThe minimum bottom location that can be applied to the layout boundaries
maxBottomINTEGERThe maximum bottom location that can be applied to the layout boundaries

From the left​

AttributeTypeDefaultDescription
leftINTEGERWhen set, the left of the layout will be located offset by the value of this property multiplied by the containing width
percentLeftINTEGERWhen set, the left of the layout will be located offset by the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%
offsetLeftINTEGERAdd additional offset to be added to the left value after it has been set
minLeftINTEGERThe minimum left location that can be applied to the layout boundaries
maxLeftINTEGERThe maximum left location that can be applied to the layout boundaries

From the right​

AttributeTypeDefaultDescription
rightINTEGERWhen set, the right of the layout will be located offset by the value of this property multiplied by the containing width
percentRightINTEGERWhen set, the right of the layout will be located offset by the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%
offsetRightINTEGERAdd additional offset to be added to the right value after it has been set
minRightINTEGERThe minimum right location that can be applied to the layout boundaries
maxRightINTEGERThe maximum right location that can be applied to the layout boundaries

Absolute positionning​

AttributeTypeDefaultDescription
xINTEGERDefines the x location (top left) of the layout boundary. Unlike left, x does not affect a layout's width. Once left (or percentLeft) is set, the x value no longer applies. If percentX exists when x is set, percentX will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the x location of that display object. The value of x itself cannot be NaN
percentXINTEGERWhen set, the x location of the layout will be located at the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%
minXINTEGERThe minimum x location that can be applied to the layout boundaries
maxXINTEGERThe maximum x location that can be applied to the layout boundaries
yINTEGERDefines the y location (top left) of the layout boundary. Unlike top, y does not affect a layout's height. Once top (or percentTop) is set, the y value no longer applies. If percentY exists when y is set, percentY will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the y location of that display object. The value of y itself cannot be NaN
percentYINTEGERWhen set, the y location of the layout will be located at the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%
minYINTEGERThe minimum y location that can be applied to the layout boundaries
maxYINTEGERThe maximum y location that can be applied to the layout boundaries

Scope​

These attributes apply to the following statement: