Class: AnchorLayoutOptions

AnchorLayoutOptions

Anchors the edge of a widget to defined offsets from the parent's insets.

The following example will render a widget at (10px, 15%) with a width extending to the parent's center and a height extending till 40px above the parent's bottom inset.

new PUXI.AnchoredLayoutOptions({
     anchorLeft: 10,
     anchorTop: .15,
     anchorRight: .5,
     anchorBottom: 40
});

You can specify how the widget should be aligned in the anchor region using the horizontalAlign and verticalAlign properties.

The width & height of widgets must be WRAP_CONTENT or FILL_PARENT. Using the latter would make the child fill the anchor region.

new AnchorLayoutOptions ()

Extends

Members

height number inherited overrides

Preferred height of the widget in pixels. If its value is between -1 and 1, it is interpreted as a percentage of the parent's height.

Default Value:
  • {PUXI.LayoutOptions.WRAP_CONTENT}

marginBottom number inherited overrides

The bottom margin in pixels of the widget.

Default Value:
  • 0

marginLeft number inherited overrides

The left margin in pixels of the widget.

Default Value:
  • 0

marginRight number inherited overrides

The right margin in pixels of the widget.

Default Value:
  • 0

marginTop number inherited overrides

This top margin in pixels of the widget.

Default Value:
  • 0

width number inherited overrides

Preferred width of the widget in pixels. If its value is between -1 and 1, it is interpreted as a percentage of the parent's width.

Default Value:
  • {PUXI.LayoutOptions.WRAP_CONTENT}