Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StackPanel

Class used to create a 2D stack panel container

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new StackPanel(name?: string | undefined): StackPanel
  • Creates a new StackPanel

    Parameters

    • Optional name: string | undefined

      defines control name

    Returns StackPanel

Properties

clipChildrenSearch playground for clipChildren

clipChildren: boolean

Gets or sets a boolean indicating if the children are clipped to the current control bounds. Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children

clipContentSearch playground for clipContent

clipContent: boolean

Gets or sets a boolean indicating that control content must be clipped Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children

fixedRatioSearch playground for fixedRatio

fixedRatio: number

Gets or sets a fixed ratio for this control. When different from 0, the ratio is used to compute the "second" dimension. The first dimension used in the computation is the last one set (by setting width / widthInPixels or height / heightInPixels), and the second dimension is computed as first dimension * fixedRatio

hoverCursorSearch playground for hoverCursor

hoverCursor: string

Gets or sets the cursor to use when the control is hovered

ignoreLayoutWarningsSearch playground for ignoreLayoutWarnings

ignoreLayoutWarnings: boolean

Gets or sets a boolean indicating that layout warnings should be ignored

isFocusInvisibleSearch playground for isFocusInvisible

isFocusInvisible: boolean

Gets or sets a boolean indicating if the control can be focusable

isHitTestVisibleSearch playground for isHitTestVisible

isHitTestVisible: boolean

Gets or sets a boolean indicating if the control can be hit with pointer events

isPointerBlockerSearch playground for isPointerBlocker

isPointerBlocker: boolean

Gets or sets a boolean indicating if the control can block pointer events

logLayoutCycleErrorsSearch playground for logLayoutCycleErrors

logLayoutCycleErrors: boolean

Gets or sets a boolean indicating that layout cycle errors should be displayed on the console

maxLayoutCycleSearch playground for maxLayoutCycle

maxLayoutCycle: number

Gets or sets the number of layout cycles (a change involved by a control while evaluating the layout) allowed

metadataSearch playground for metadata

metadata: any

Gets or sets an object used to store user defined information for the node

Optional nameSearch playground for name

name: string | undefined

onAfterDrawObservableSearch playground for onAfterDrawObservable

onAfterDrawObservable: Observable<Control>

An event triggered after the control was drawn

onBeforeDrawObservableSearch playground for onBeforeDrawObservable

onBeforeDrawObservable: Observable<Control>

An event triggered before drawing the control

onDirtyObservableSearch playground for onDirtyObservable

onDirtyObservable: Observable<Control>

An event triggered when the control is marked as dirty

onDisposeObservableSearch playground for onDisposeObservable

onDisposeObservable: Observable<Control>

An event triggered when the control has been disposed

onPointerClickObservableSearch playground for onPointerClickObservable

onPointerClickObservable: Observable<Vector2WithInfo>

An event triggered when a control is clicked on

onPointerDownObservableSearch playground for onPointerDownObservable

onPointerDownObservable: Observable<Vector2WithInfo>

An event triggered when the pointer taps the control

onPointerEnterObservableSearch playground for onPointerEnterObservable

onPointerEnterObservable: Observable<Control>

An event triggered when pointer enters the control

onPointerMoveObservableSearch playground for onPointerMoveObservable

onPointerMoveObservable: Observable<Vector2>

An event triggered when the pointer moves over the control.

onPointerOutObservableSearch playground for onPointerOutObservable

onPointerOutObservable: Observable<Control>

An event triggered when the pointer moves out of the control.

onPointerUpObservableSearch playground for onPointerUpObservable

onPointerUpObservable: Observable<Vector2WithInfo>

An event triggered when pointer up

onWheelObservableSearch playground for onWheelObservable

onWheelObservable: Observable<Vector2>

An event triggered when pointer wheel is scrolled

Optional overlapDeltaMultiplierSearch playground for overlapDeltaMultiplier

overlapDeltaMultiplier: number

Gets/sets the deoverlap movement multiplier

Optional overlapGroupSearch playground for overlapGroup

overlapGroup: number

Gets/sets the overlap group of the control. Controls with overlapGroup set to a number can be deoverlapped. Controls with overlapGroup set to undefined are not deoverlapped.

see

https://doc.babylonjs.com/how_to/gui#deoverlapping

parentSearch playground for parent

Gets or sets the control parent

uniqueIdSearch playground for uniqueId

uniqueId: number

Gets or sets the unique id of the node. Please note that this number will be updated when the control is added to a container

useBitmapCacheSearch playground for useBitmapCache

useBitmapCache: boolean

Gets or sets a boolean indicating that the current control should cache its rendering (useful when the control does not change often)

Static AddHeaderSearch playground for AddHeader

AddHeader: (control: Control, text: string, size: string | number, options: { controlFirst: boolean; isHorizontal: boolean }) => any

Type declaration

    • (control: Control, text: string, size: string | number, options: { controlFirst: boolean; isHorizontal: boolean }): any
    • Parameters

      • control: Control
      • text: string
      • size: string | number
      • options: { controlFirst: boolean; isHorizontal: boolean }
        • controlFirst: boolean
        • isHorizontal: boolean

      Returns any

Static AllowAlphaInheritanceSearch playground for AllowAlphaInheritance

AllowAlphaInheritance: boolean

Gets or sets a boolean indicating if alpha must be an inherited value (false by default)

Accessors

adaptHeightToChildren

  • get adaptHeightToChildren(): boolean
  • set adaptHeightToChildren(value: boolean): any
  • Gets or sets a boolean indicating if the container should try to adapt to its children height

    Returns boolean

  • Gets or sets a boolean indicating if the container should try to adapt to its children height

    Parameters

    • value: boolean

    Returns any

adaptWidthToChildren

  • get adaptWidthToChildren(): boolean
  • set adaptWidthToChildren(value: boolean): any
  • Gets or sets a boolean indicating if the container should try to adapt to its children width

    Returns boolean

  • Gets or sets a boolean indicating if the container should try to adapt to its children width

    Parameters

    • value: boolean

    Returns any

alpha

  • get alpha(): number
  • set alpha(value: number): any
  • Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent)

    Returns number

  • Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent)

    Parameters

    • value: number

    Returns any

background

  • get background(): string
  • set background(value: string): any
  • Gets or sets background color

    Returns string

  • Gets or sets background color

    Parameters

    • value: string

    Returns any

centerX

  • get centerX(): number
  • Gets the center coordinate on X axis

    Returns number

centerY

  • get centerY(): number
  • Gets the center coordinate on Y axis

    Returns number

children

  • Gets the list of children

    Returns Control[]

color

  • get color(): string
  • set color(value: string): any
  • Gets or sets foreground color

    Returns string

  • Gets or sets foreground color

    Parameters

    • value: string

    Returns any

descendantsOnlyPadding

  • get descendantsOnlyPadding(): boolean
  • set descendantsOnlyPadding(value: boolean): any
  • Gets or sets a value indicating the padding should work like in CSS. Basically, it will add the padding amount on each side of the parent control for its children.

    Returns boolean

  • Gets or sets a value indicating the padding should work like in CSS. Basically, it will add the padding amount on each side of the parent control for its children.

    Parameters

    • value: boolean

    Returns any

disabledColor

  • get disabledColor(): string
  • set disabledColor(value: string): any
  • Gets or sets background color of control if it's disabled. Only applies to Button class.

    Returns string

  • Gets or sets background color of control if it's disabled. Only applies to Button class.

    Parameters

    • value: string

    Returns any

disabledColorItem

  • get disabledColorItem(): string
  • set disabledColorItem(value: string): any
  • Gets or sets front color of control if it's disabled. Only applies to Checkbox class.

    Returns string

  • Gets or sets front color of control if it's disabled. Only applies to Checkbox class.

    Parameters

    • value: string

    Returns any

fontFamily

  • get fontFamily(): string
  • set fontFamily(value: string): any
  • Gets or set font family

    Returns string

  • Gets or set font family

    Parameters

    • value: string

    Returns any

fontOffset

  • get fontOffset(): { ascent: number; descent: number; height: number }
  • set fontOffset(offset: { ascent: number; descent: number; height: number }): any
  • Gets or set information about font offsets (used to render and align text)

    Returns { ascent: number; descent: number; height: number }

    • ascent: number
    • descent: number
    • height: number
  • Gets or set information about font offsets (used to render and align text)

    Parameters

    • offset: { ascent: number; descent: number; height: number }
      • ascent: number
      • descent: number
      • height: number

    Returns any

fontSize

  • get fontSize(): string | number
  • set fontSize(value: string | number): any
  • Gets or sets font size

    Returns string | number

  • Gets or sets font size

    Parameters

    • value: string | number

    Returns any

fontSizeInPixels

  • get fontSizeInPixels(): number
  • set fontSizeInPixels(value: number): any
  • Gets or sets font size in pixels

    Returns number

  • Gets or sets font size in pixels

    Parameters

    • value: number

    Returns any

fontStyle

  • get fontStyle(): string
  • set fontStyle(value: string): any
  • Gets or sets font style

    Returns string

  • Gets or sets font style

    Parameters

    • value: string

    Returns any

fontWeight

  • get fontWeight(): string
  • set fontWeight(value: string): any
  • Gets or sets font weight

    Returns string

  • Gets or sets font weight

    Parameters

    • value: string

    Returns any

height

  • get height(): string | number
  • set height(value: string | number): any
  • Gets or sets panel height. This value should not be set when in vertical mode as it will be computed automatically

    Returns string | number

  • Gets or sets panel height. This value should not be set when in vertical mode as it will be computed automatically

    Parameters

    • value: string | number

    Returns any

heightInPixels

  • get heightInPixels(): number
  • set heightInPixels(value: number): any

highlightColor

  • get highlightColor(): string
  • set highlightColor(value: string): any
  • Gets or sets a string defining the color to use for highlighting this control

    Returns string

  • Gets or sets a string defining the color to use for highlighting this control

    Parameters

    • value: string

    Returns any

highlightLineWidth

  • get highlightLineWidth(): number
  • set highlightLineWidth(value: number): any
  • Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)

    Returns number

  • Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)

    Parameters

    • value: number

    Returns any

horizontalAlignment

  • get horizontalAlignment(): number
  • set horizontalAlignment(value: number): any

host

isDirty

  • get isDirty(): boolean
  • Gets a boolean indicating that the control needs to update its rendering

    Returns boolean

isEnabled

  • get isEnabled(): boolean
  • set isEnabled(value: boolean): any
  • Gets or sets if control is Enabled

    Returns boolean

  • Gets or sets if control is Enabled

    Parameters

    • value: boolean

    Returns any

isHighlighted

  • get isHighlighted(): boolean
  • set isHighlighted(value: boolean): any
  • Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)

    Returns boolean

  • Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)

    Parameters

    • value: boolean

    Returns any

isReadOnly

  • get isReadOnly(): boolean
  • set isReadOnly(value: boolean): any

isVertical

  • get isVertical(): boolean
  • set isVertical(value: boolean): any
  • Gets or sets a boolean indicating if the stack panel is vertical or horizontal

    Returns boolean

  • Gets or sets a boolean indicating if the stack panel is vertical or horizontal

    Parameters

    • value: boolean

    Returns any

isVisible

  • get isVisible(): boolean
  • set isVisible(value: boolean): any
  • Gets or sets a boolean indicating if the control is visible

    Returns boolean

  • Gets or sets a boolean indicating if the control is visible

    Parameters

    • value: boolean

    Returns any

left

  • get left(): string | number
  • set left(value: string | number): any

leftInPixels

  • get leftInPixels(): number
  • set leftInPixels(value: number): any

linkOffsetX

  • get linkOffsetX(): string | number
  • set linkOffsetX(value: string | number): any

linkOffsetXInPixels

  • get linkOffsetXInPixels(): number
  • set linkOffsetXInPixels(value: number): any

linkOffsetY

  • get linkOffsetY(): string | number
  • set linkOffsetY(value: string | number): any

linkOffsetYInPixels

  • get linkOffsetYInPixels(): number
  • set linkOffsetYInPixels(value: number): any

linkedMesh

notRenderable

  • get notRenderable(): boolean
  • set notRenderable(value: boolean): any
  • Gets or sets a boolean indicating if the control can be rendered

    Returns boolean

  • Gets or sets a boolean indicating if the control can be rendered

    Parameters

    • value: boolean

    Returns any

paddingBottom

  • get paddingBottom(): string | number
  • set paddingBottom(value: string | number): any

paddingBottomInPixels

  • get paddingBottomInPixels(): number
  • set paddingBottomInPixels(value: number): any

paddingLeft

  • get paddingLeft(): string | number
  • set paddingLeft(value: string | number): any

paddingLeftInPixels

  • get paddingLeftInPixels(): number
  • set paddingLeftInPixels(value: number): any

paddingRight

  • get paddingRight(): string | number
  • set paddingRight(value: string | number): any

paddingRightInPixels

  • get paddingRightInPixels(): number
  • set paddingRightInPixels(value: number): any

paddingTop

  • get paddingTop(): string | number
  • set paddingTop(value: string | number): any

paddingTopInPixels

  • get paddingTopInPixels(): number
  • set paddingTopInPixels(value: number): any

renderToIntermediateTexture

  • get renderToIntermediateTexture(): boolean
  • set renderToIntermediateTexture(value: boolean): any
  • Gets or sets boolean indicating if children should be rendered to an intermediate texture rather than directly to host, useful for alpha blending

    Returns boolean

  • Gets or sets boolean indicating if children should be rendered to an intermediate texture rather than directly to host, useful for alpha blending

    Parameters

    • value: boolean

    Returns any

rotation

  • get rotation(): number
  • set rotation(value: number): any

scaleX

  • get scaleX(): number
  • set scaleX(value: number): any

scaleY

  • get scaleY(): number
  • set scaleY(value: number): any

shadowBlur

  • get shadowBlur(): number
  • set shadowBlur(value: number): any
  • Gets or sets a value indicating the amount of blur to use to render the shadow

    Returns number

  • Gets or sets a value indicating the amount of blur to use to render the shadow

    Parameters

    • value: number

    Returns any

shadowColor

  • get shadowColor(): string
  • set shadowColor(value: string): any
  • Gets or sets a value indicating the color of the shadow (black by default ie. "#000")

    Returns string

  • Gets or sets a value indicating the color of the shadow (black by default ie. "#000")

    Parameters

    • value: string

    Returns any

shadowOffsetX

  • get shadowOffsetX(): number
  • set shadowOffsetX(value: number): any
  • Gets or sets a value indicating the offset to apply on X axis to render the shadow

    Returns number

  • Gets or sets a value indicating the offset to apply on X axis to render the shadow

    Parameters

    • value: number

    Returns any

shadowOffsetY

  • get shadowOffsetY(): number
  • set shadowOffsetY(value: number): any
  • Gets or sets a value indicating the offset to apply on Y axis to render the shadow

    Returns number

  • Gets or sets a value indicating the offset to apply on Y axis to render the shadow

    Parameters

    • value: number

    Returns any

spacing

  • get spacing(): number
  • set spacing(value: number): any
  • Gets or sets the spacing (in pixels) between each child.

    Returns number

  • Gets or sets the spacing (in pixels) between each child.

    Parameters

    • value: number

    Returns any

style

top

  • get top(): string | number
  • set top(value: string | number): any

topInPixels

  • get topInPixels(): number
  • set topInPixels(value: number): any

transformCenterX

  • get transformCenterX(): number
  • set transformCenterX(value: number): any

transformCenterY

  • get transformCenterY(): number
  • set transformCenterY(value: number): any

transformedMeasure

  • get transformedMeasure(): Measure
  • Gets the transformed measure, that is the bounding box of the control after applying all transformations

    Returns Measure

typeName

  • get typeName(): string
  • Gets the control type name

    Returns string

verticalAlignment

  • get verticalAlignment(): number
  • set verticalAlignment(value: number): any

width

  • get width(): string | number
  • set width(value: string | number): any
  • Gets or sets panel width. This value should not be set when in horizontal mode as it will be computed automatically

    Returns string | number

  • Gets or sets panel width. This value should not be set when in horizontal mode as it will be computed automatically

    Parameters

    • value: string | number

    Returns any

widthInPixels

  • get widthInPixels(): number
  • set widthInPixels(value: number): any

zIndex

  • get zIndex(): number
  • set zIndex(value: number): any
  • Gets or sets z index which is used to reorder controls on the z axis

    Returns number

  • Gets or sets z index which is used to reorder controls on the z axis

    Parameters

    • value: number

    Returns any

Static HORIZONTAL_ALIGNMENT_CENTER

  • get HORIZONTAL_ALIGNMENT_CENTER(): number

Static HORIZONTAL_ALIGNMENT_LEFT

  • get HORIZONTAL_ALIGNMENT_LEFT(): number

Static HORIZONTAL_ALIGNMENT_RIGHT

  • get HORIZONTAL_ALIGNMENT_RIGHT(): number

Static VERTICAL_ALIGNMENT_BOTTOM

  • get VERTICAL_ALIGNMENT_BOTTOM(): number

Static VERTICAL_ALIGNMENT_CENTER

  • get VERTICAL_ALIGNMENT_CENTER(): number

Static VERTICAL_ALIGNMENT_TOP

  • get VERTICAL_ALIGNMENT_TOP(): number

Methods

_flagDescendantsAsMatrixDirtySearch playground for _flagDescendantsAsMatrixDirty

  • _flagDescendantsAsMatrixDirty(): void

addControlSearch playground for addControl

  • Adds a new control to the current container

    Parameters

    Returns Container

    the current container

clearControlsSearch playground for clearControls

  • Removes all controls from the current container

    Returns Container

    the current container

containsSearch playground for contains

  • contains(x: number, y: number): boolean
  • Tests if a given coordinates belong to the current control

    Parameters

    • x: number

      defines x coordinate to test

    • y: number

      defines y coordinate to test

    Returns boolean

    true if the coordinates are inside the control

containsControlSearch playground for containsControl

  • containsControl(control: Control): boolean
  • Search for a specific control in children

    Parameters

    • control: Control

      defines the control to look for

    Returns boolean

    true if the control is in child list

disposeSearch playground for dispose

  • dispose(): void
  • Releases associated resources

    Returns void

getAscendantOfClassSearch playground for getAscendantOfClass

  • Gets the first ascendant in the hierarchy of the given type

    Parameters

    • className: string

      defines the required type

    Returns Nullable<Control>

    the ascendant or null if not found

getChildByNameSearch playground for getChildByName

  • Gets a child using its name

    Parameters

    • name: string

      defines the child name to look for

    Returns Nullable<Control>

    the child control if found

getChildByTypeSearch playground for getChildByType

  • Gets a child using its type and its name

    Parameters

    • name: string

      defines the child name to look for

    • type: string

      defines the child type to look for

    Returns Nullable<Control>

    the child control if found

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Get the current class name of the control.

    Returns string

    current class name

getDescendantsSearch playground for getDescendants

  • getDescendants(directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): Control[]
  • Will return all controls that have this control as ascendant

    Parameters

    • Optional directDescendantsOnly: boolean

      defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered

    • Optional predicate: (control: Control) => boolean

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

        • Parameters

          Returns boolean

    Returns Control[]

    all child controls

getDescendantsToRefSearch playground for getDescendantsToRef

  • getDescendantsToRef(results: Control[], directDescendantsOnly?: boolean, predicate?: (control: Control) => boolean): void

getLocalCoordinatesSearch playground for getLocalCoordinates

  • Gets coordinates in local control space

    Parameters

    • globalCoordinates: Vector2

      defines the coordinates to transform

    Returns Vector2

    the new coordinates in local space

getLocalCoordinatesToRefSearch playground for getLocalCoordinatesToRef

  • Gets coordinates in local control space

    Parameters

    • globalCoordinates: Vector2

      defines the coordinates to transform

    • result: Vector2

      defines the target vector2 where to store the result

    Returns Control

    the current control

getParentLocalCoordinatesSearch playground for getParentLocalCoordinates

  • Gets coordinates in parent local control space

    Parameters

    • globalCoordinates: Vector2

      defines the coordinates to transform

    Returns Vector2

    the new coordinates in parent local space

isAscendantSearch playground for isAscendant

  • isAscendant(container: Control): boolean
  • Determines if a container is an ascendant of the current control

    Parameters

    • container: Control

      defines the container to look for

    Returns boolean

    true if the container is one of the ascendant of the control

linkWithMeshSearch playground for linkWithMesh

markAllAsDirtySearch playground for markAllAsDirty

  • markAllAsDirty(): void
  • Mark the element and its children as dirty

    Returns void

markAsDirtySearch playground for markAsDirty

  • markAsDirty(force?: boolean): void
  • Mark control element as dirty

    Parameters

    • Optional force: boolean

      force non visible elements to be marked too

    Returns void

moveToVector3Search playground for moveToVector3

  • Move the current control to a vector3 position projected onto the screen.

    Parameters

    • position: Vector3

      defines the target position

    • scene: Scene

      defines the hosting scene

    Returns void

removeControlSearch playground for removeControl

  • Removes a control from the current container

    Parameters

    • control: Control

      defines the control to remove

    Returns Container

    the current container

serializeSearch playground for serialize

  • serialize(serializationObject: any): void
  • Serializes the current control

    Parameters

    • serializationObject: any

      defined the JSON serialized object

    Returns void

setPaddingSearch playground for setPadding

  • setPadding(paddingTop: string | number, paddingRight?: string | number, paddingBottom?: string | number, paddingLeft?: string | number): void
  • Shorthand function to set the top, right, bottom, and left padding values on the control.

    see

    https://doc.babylonjs.com/how_to/gui#position-and-size

    Parameters

    • paddingTop: string | number

      The value of the top padding.

    • Optional paddingRight: string | number

      The value of the right padding. If omitted, top is used.

    • Optional paddingBottom: string | number

      The value of the bottom padding. If omitted, top is used.

    • Optional paddingLeft: string | number

      The value of the left padding. If omitted, right is used.

    Returns void

setPaddingInPixelsSearch playground for setPaddingInPixels

  • setPaddingInPixels(paddingTop: number, paddingRight?: number, paddingBottom?: number, paddingLeft?: number): void
  • Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.

    see

    https://doc.babylonjs.com/how_to/gui#position-and-size

    Parameters

    • paddingTop: number

      The value in pixels of the top padding.

    • Optional paddingRight: number

      The value in pixels of the right padding. If omitted, top is used.

    • Optional paddingBottom: number

      The value in pixels of the bottom padding. If omitted, top is used.

    • Optional paddingLeft: number

      The value in pixels of the left padding. If omitted, right is used.

    Returns void

Static ParseSearch playground for Parse

  • Creates a Control from parsed data

    Parameters

    • serializedObject: any

      defines parsed data

    • host: AdvancedDynamicTexture

      defines the hosting AdvancedDynamicTexture

    Returns Control

    a new Control

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static property
  • Static method