Class: TiledLayout

TiledLayout

TiledLayout

new GOWN.layout.TiledLayout()

A layout for tiled rows/columns

Extends

Members

static,readonlyGOWN.layout.TiledLayout.ORIENTATION_COLUMNSString

Orientation by columns

static,readonlyGOWN.layout.TiledLayout.ORIENTATION_ROWSString

Orientation by rows

static,readonlyGOWN.layout.TiledLayout.PAGING_HORIZONTALString

The items will be positioned in pages horizontally from left to right.

static,readonlyGOWN.layout.TiledLayout.PAGING_NONEString

The items will not be positioned in pages.

static,readonlyGOWN.layout.TiledLayout.PAGING_VERTICALString

The items will be positioned in pages vertically from top to bottom.

static,readonlyGOWN.layout.TiledLayout.TILE_HORIZONTAL_ALIGN_CENTERString

If an item width is smaller than the width of a tile, the item will be aligned to the center of the tile.

static,readonlyGOWN.layout.TiledLayout.TILE_HORIZONTAL_ALIGN_JUSTIFYString

The item will be resized to fit the width of the tile.

static,readonlyGOWN.layout.TiledLayout.TILE_HORIZONTAL_ALIGN_LEFTString

If an item width is smaller than the width of a tile, the item will be aligned to the left edge of the tile.

static,readonlyGOWN.layout.TiledLayout.TILE_HORIZONTAL_ALIGN_RIGHTString

If an item width is smaller than the width of a tile, the item will be aligned to the right edge of the tile.

static,readonlyGOWN.layout.TiledLayout.TILE_VERTICAL_ALIGN_BOTTOMString

If an item height is smaller than the height of a tile, the item will be aligned to the bottom edge of the tile.

static,readonlyGOWN.layout.TiledLayout.TILE_VERTICAL_ALIGN_JUSTIFYString

The item will be resized to fit the height of the tile.

static,readonlyGOWN.layout.TiledLayout.TILE_VERTICAL_ALIGN_MIDDLEString

If an item height is smaller than the height of a tile, the item will be aligned to the middle of the tile.

static,readonlyGOWN.layout.TiledLayout.TILE_VERTICAL_ALIGN_TOPString

If an item height is smaller than the height of a tile, the item will be aligned to the top edge of the tile.

gapNumber

The space, in pixels, between items.
Default Value:
  • 0

readonlyneedUpdate

Indicates if the layout needs to be rearranged.

paddingNumber

Shortcut to set all paddings (left, right, top, bottom)
Default Value:
  • 0

paddingBottomNumber

The minimum space, in pixels, below the items.
Default Value:
  • 0

paddingLeftNumber

The space, in pixels, that appears to the left, before the first item.
Default Value:
  • 0

paddingTopNumber

The minimum space, in pixels, above the items.
Default Value:
  • 0

useSquareTilesbool

Use the same width and height for tiles (calculated by biggest square)
Default Value:
  • false

Methods

layout(items, maxWidth, maxHeight)

Position (and possibly resize) the supplied items.
Name Type Description
items Array The items that will be layouted
maxWidth Number The maximum width for the items
maxHeight Number The maximum height for the items
Returns:
Number[] The width and height

layoutContainer(container)

Calculate the layout for a container (and its children)
Name Type Description
container The container to calculate the layout for
Returns:
Number[] The width and height