Skip to content

WrapPanel

Flow container wrapping children to a new row or column when space is exceeded.

Overview

WrapPanel is a multi-line flow container (FlexWrap.WRAP). In horizontal orientation, children flow left-to-right and wrap onto new lines when the container boundary is reached. In vertical orientation, children flow top-to-bottom and wrap into new columns.

  • spacing(px): Distance between items within the same line.
  • lineSpacing(px): Distance between consecutive wrapped lines.

Tag Chip Cloud

WrapPanel chips = new WrapPanel()
        .spacing(6.0f)
        .lineSpacing(6.0f);
chips.addChild(new Chip("Action"));
chips.addChild(new Chip("Adventure"));
chips.addChild(new Chip("RPG"));

API

WrapPanel()

Constructor

Creates a WrapPanel with HORIZONTAL orientation.

WrapPanel::orientation(Orientation)

Set Orientation

Sets flow direction (HORIZONTAL rows or VERTICAL columns).

Parameter Type Description
orientation Orientation target orientation

Returns WrapPanel: this widget for fluent configuration.

WrapPanel::spacing(float)

Set Item Spacing

Sets gap in pixels between items on the same line.

Parameter Type Description
spacing float spacing in UI pixels

Returns WrapPanel: this widget for fluent configuration.

WrapPanel::lineSpacing(float)

Set Line Spacing

Sets gap in pixels between consecutive wrapped lines.

Parameter Type Description
lineSpacing float line gap in UI pixels

Returns WrapPanel: this widget for fluent configuration.