Class: LayoutGroup

LayoutGroup

LayoutGroup

new GOWN.LayoutGroup(layout, maxWidth, maxHeight)

The LayoutGroup allows you to add PIXI.js children that will be positioned
Name Type Default Description
layout GOWN.LayoutAlignment The layout for the layout group
maxWidth Number Infinity optional The maximum width of the layout group
maxHeight Number Infinity optional The maximum height of the layout group

Extends

Members

enabledBoolean

Enables/Disables the control. (not implemented yet)

heightNumber

The height of the group, will get the position and the height of the bottom child.

layoutGOWN.LayoutAlignment

The layout for the layout group

maxHeightNumber

The maximum height of the layout group
Default Value:
  • Infinity

maxWidthNumber

The maximum width of the layout group
Default Value:
  • Infinity

percentHeightNumber

The percentage height of the positioned children

percentWidthNumber

The percentage width of the positioned children

widthNumber

The width of the group, will get the position and the width of the right child.

Methods

addChild(child){PIXI.DisplayObject}

Adds one or more children to the container. Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`
Name Type Description
child PIXI.DisplayObject repeatable The DisplayObject(s) to add to the container
Returns:
Type Description
PIXI.DisplayObject The first child that was added.

addChildAt(child, index){PIXI.DisplayObject}

Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
Name Type Description
child PIXI.DisplayObject The child to add
index number The index to place the child in
Returns:
Type Description
PIXI.DisplayObject The child that was added.

addSpacer(space)

Add some space between children
Name Type Description
space Number Space between children

childIsRenderAble(child, x, y, width, height){boolean}

Indicates if the given child is inside the viewport (only used for scrolling)
Name Type Description
child PIXI.DisplayObject One child with set coordinates and dimensions
x Number X-position on the scroll-container
y Number Y-position on the scroll-container
width Number Width of the viewport
height Number Height of the viewport
Returns:
Type Description
boolean

inherited mousePos(){PIXI.Point}

Get the local mouse position from PIXI.InteractionData
Returns:
Type Description
PIXI.Point

protectedonResize()

onResize callback

protectedredraw()

Update before draw call (position label) (called from Control.prototype.updateTransform every frame)

inherited setTheme(theme)

Change the theme (every control can have a theme, even if it does not inherit Skinable, e.g. if there is only some color in the skin that will be taken or if it has some skinable components as children)
Name Type Description
theme GOWN.Theme the new theme

updateRenderable(x, y, width, height)

Update renderable (culling of non visible objects)
Name Type Description
x Number X-position on the scroll-container
y Number Y-position on the scroll-container
width Number width of the viewport
height Number height of the viewport