Constructors

  • Creates an instance of Flex class

    Parameters

    Returns Flex

Properties

_basisSum: number
_bounds: {
    bottom: number;
    left: number;
    right: number;
    top: number;
}

Type declaration

  • bottom: number
  • left: number
  • right: number
  • top: number
_fparent: Flex
_growSum: number
_heights: number[]
_isFlex: boolean
_scrollFactorX: number
_scrollFactorY: number
_shrinkSum: number
_widths: number[]
alignItems: number

Alignment of the items with respect to the cross axis. (Default = AlignItems.CENTER)

basis: number

Original size of this object in the main axis.

flexDirection: number

Sets how items are placed in the flex object defining the main axis. (Default = FlexDirection.ROW)

flexGrow: number
flexShrink: number
height: number

Height of this object. (Default = 0)

items: Item[]

Array of all items managed by this object.

itemsMargin: number

Minimum distance between items contained inside this object. (Default = 4)

justifyContent: number

Alignment of the items with respect to the main axis. (Default = JustifyContent.FLEX_START)

origin: {
    x: number;
    y: number;
}

Position of this object anchor relative to its width and height. (x and y between 0 and 1). Sets how this object is placed.

Type declaration

  • x: number
  • y: number
padding: number

Minimum distance between this object content and its border. (Default = 10)

scene: Scene
width: number

Width of this object. (Default = 0)

x: number

X position. (Default = 0)

y: number

Y position. (Default = 0)

Methods

  • Adds an item to the items list of this object. The position and size of this items are managed by this object.

    Parameters

    • item: Item
    • flexGrow: number = 0
    • flexShrink: number = 1

    Returns Flex

    This Flex instance.

  • Each item managed by this object are destroyed.

    Returns Flex

    This Flex instance.

  • Disposes all resources used by this object.

    Returns void

  • An item is removed from the items list managed by this flex object.

    Parameters

    • index: number

      Index of the item to be removed in the items array of this instance.

    • destroy: boolean

      The item should be destroyed?.

    Returns Flex

    This Flex instance.

  • Sets the alignItems property of this object.

    Parameters

    Returns Flex

    This Flex instance.

  • Sets the height of this object.

    Parameters

    • height: number

    Returns Flex

    This Flex instance.

  • Sets the justifyContent property of this object.

    Parameters

    Returns Flex

    This Flex instance.

  • Sets the origin property of this object.

    Parameters

    • x: number
    • y: number

    Returns Flex

    This Flex instance.

  • Sets the scrollFactor property of this object.

    Parameters

    • x: number
    • y: number

    Returns Flex

    This Flex instance.

  • Sets the size of this object.

    Parameters

    • width: number
    • height: number

    Returns Flex

    This Flex instance.

  • Sets the width of this object.

    Parameters

    • width: number

    Returns Flex

    This Flex instance.

  • Sets the x position of this object.

    Parameters

    • x: number

    Returns Flex

    This Flex instance.

  • Sets the y position of this object.

    Parameters

    • y: number

    Returns Flex

    This Flex instance.

  • Updates items positions. Should be used only if any item have changed its size.

    Returns void

Generated using TypeDoc