Options
All
  • Public
  • Public/Protected
  • All
V1.7
  • V1.6
  • V1.7
Menu

Class UiPanel

UiPanel - Represents an area to group elements and to confine cursor interactions within a shaped boundary.

The boundary shape is a rounded rectangular area, from sharp corner to circular, where the cursor can be restricted within or provide means to move between different UiPanel areas.

Hierarchy

Index

Methods

Methods

addChild

  • addChild(a_pChild: Node | null): boolean
  • Adds a child to the current Node, removing it from its current parent.

    A child can only have a single Parent

    priv

    none

    Parameters

    • a_pChild: Node | null

      The Node to add as a child to this Node.

    Returns boolean

    true if successful, false if failed

addExternalGravityWell

  • addExternalGravityWell(uiNode: UiNode | null): void
  • Adds an external UiNode gravity well for consideration when interacting with this Panel.

    Use the external gravity well list to add specific UiNode gravity wells for consideration with this Panel when those nodes are not normally descendants. This is only intended for relatively small lists of nodes and may not be performant if very large lists of external nodes are used.

    priv

    none

    Parameters

    • uiNode: UiNode | null

      The UiNode to add to the external gravity well list

    Returns void

addMoveCallback

  • addMoveCallback(track?: number): void
  • Adds a client-side callback event to the move list. When the event is reached during the animation playback, the ServerEventCallback function set in Client will be called with an event TransformAnimationEventData.

    priv

    none

    Parameters

    • Optional track: number

    Returns void

addToLayer

  • addToLayer(a_layer: bigint): void

clearAllEventSounds

  • clearAllEventSounds(): void

clearEventSound

clearExternalGravityWells

  • clearExternalGravityWells(): void

delayMove

  • delayMove(durationSecs: number, track?: number): void
  • Adds a delay to the current move sequence.

    priv

    none

    Parameters

    • durationSecs: number

      How long to delay, in seconds.

    • Optional track: number

      default = 0
      which animation track to add the delay to.

    Returns void

findChild

  • findChild(name: string): Node | null
  • Find the first named child in the node hierarchy, including this Node.

    Does a breadth-first search of the child node hierarchy for the specified named Node and will return the first encountered match, or nullptr if no named Node found.

    priv

    none

    Parameters

    • name: string

      The name to search for.

    Returns Node | null

findChildren

  • findChildren(a_type: number, a_bExactType?: boolean, a_bIncludeSelf?: boolean): Array<Node | null>
  • Does a breadth-first search of the child node hierarchy for the specified Node type.

    priv

    none

    Parameters

    • a_type: number

      The type of Node to find in the child hierarchy.

    • Optional a_bExactType: boolean

      default = false
      Flag to indicate if the child node must be the exact type or can be derived from the type (default false).

    • Optional a_bIncludeSelf: boolean

      default = false
      Flag to indicate if the search should include this Node (default false).

    Returns Array<Node | null>

    A vector of Node pointers containing the results.

findParent

  • findParent(a_type: number, a_bExactType?: boolean): Node | null
  • Searches up the tree parentage for the specific Node type.

    priv

    none

    Parameters

    • a_type: number

      The type of Node to find in the parent hierarchy.

    • Optional a_bExactType: boolean

      default = false
      Flag to indicate if the parent node must be the exact type or can be derived from the type (default false).

    Returns Node | null

    The parent node, if found, null if not found.

getAABB

  • Get the AABB of this Node's full hierarchy, including all descendants, with all Node transforms applied.

    The returned AABB encompasses this Node and all descendant Nodes and is aligned to the coordinate system the Node resides within, i.e. the Node's parent coordinate system. Note, the returned AABB is not guaranteed to be the minimal, tightest fitting AABB to encompass the Node's descendant hierarchy, but it will fully enlose the Node's hierarchy.

    priv

    none

    Returns AABB

    The bounding box

getAlignment

getAnchorPosition

  • getAnchorPosition(): [number, number, number]

getChild

  • getChild(a_iIndex: number): Node | null

getChildCount

  • getChildCount(): number

getCurrentPrismTransform

  • getCurrentPrismTransform(): [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]
  • Get the Cached Prism Transform of this Node

    priv

    none

    Returns [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

    Transform Matrix

getCurrentWorldTransform

  • getCurrentWorldTransform(): [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]
  • Get the Cached World Transform of this Node

    priv

    none

    Returns [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

    Transform Matrix

getCursorConstrained

  • getCursorConstrained(): boolean
  • Gets whether the UiPanel constrains cursor movement or not.

    priv

    none

    Returns boolean

    true if the cursor is constrained, false otherwise.

getCursorHoverState

getCursorInitialPosition

  • getCursorInitialPosition(): [number, number, number]
  • Gets the initial position of the cursor for a Panel-to-Panel transition.

    priv

    none

    Returns [number, number, number]

    the cursor initial position within the Panel.

getCursorTransitionType

getCursorVisible

  • getCursorVisible(): boolean
  • Gets whether the cursor is visible while inside the UiPanel.

    priv

    none

    Returns boolean

    true if the cursor is visible inside the UiPanel, false otherwise.

getEdgeConstraint

  • getEdgeConstraint(side: Side): number
  • Gets the edge constraint properties for a Side of the Panel shape.

    priv

    none

    Parameters

    • side: Side

      the Side of the boundary shape to get the properties for.

    Returns number

    • the escape magnitude constraint for the cursor on the specified side.

getEdgeConstraintLevel

getEdgeTransition

  • Gets the edge transition Panel for a Side.

    priv

    none

    Parameters

    • side: Side

      the Side of the boundary shape to get the properties for.

    Returns UiPanel | null

    • the UiPanel to transition to for the specified side. A nullptr means no transition.

getEnabled

  • getEnabled(): boolean

getEscapeMagnitude

  • getEscapeMagnitude(side: Side): number
  • Gets the current, accumulated escape magnitude for a Side.

    priv

    none

    Parameters

    Returns number

    • the accumulated escape magnitude for the specified side.

getEventPassThrough

  • getEventPassThrough(): boolean

getEventSound

  • Gets the Sound for the specified event, if set. If no sound ID set for the specified event, nullptr will be returned.

    priv

    none

    Parameters

    • event: SoundEvent

      The sound event to get the Sound for.

    Returns Sound | null

    Pointer to the Sound object associated with the sound ID for the event or nullptr if no sound set.

getEventSoundID

getFocused

  • getFocused(): boolean

getGravityWellEnabled

  • getGravityWellEnabled(): boolean

getGravityWellProperties

getHideBounds

  • getHideBounds(): boolean

getHovered

  • getHovered(): boolean

getLocalAABB

  • getLocalAABB(): AABB
  • Get the local AABB of this Node only, not including children, aligned to this Node's local coordinate system.

    A local AABB of math::AABB::EMPTY indicates the Node either has no visual information or that local AABB is not supported for the Node.

    Note: The local AABB for ModelNodes is currently not supported and will report math::AABB::EMPTY.

    priv

    none

    Returns AABB

    The bounding box.

getLocalPosition

  • getLocalPosition(): [number, number, number]

getLocalRotation

  • getLocalRotation(): [number, number, number, number]

getLocalScale

  • getLocalScale(): [number, number, number]

getLocalTransform

  • getLocalTransform(): [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]
  • Get the Local Transform of this Node

    priv

    none

    Returns [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]

    Transform Matrix

getName

  • getName(): string
  • Get the name of the Node.

    This call returns EMPTY_STRING if the Node's name has not been set.

    priv

    none

    Returns string

    The name of the Node, if set.

getNodeId

  • getNodeId(): bigint

getNormalizedEscapeMagnitude

  • getNormalizedEscapeMagnitude(side: Side): number
  • Gets the normalized escape magnitude for a Side.

    priv

    none

    Parameters

    Returns number

    • the normalized escape magnitude for the specified side.

getOnActivateResponse

getPanelShape

getParent

  • getParent(): Node | null

getParentedBoneName

  • getParentedBoneName(): string

getPrismId

  • getPrismId(): bigint

getPrismPosition

  • getPrismPosition(): [number, number, number]

getRenderingLayer

  • getRenderingLayer(): number

getRigidBody

getRoot

getWorldPosition

  • getWorldPosition(): [number, number, number]

isExternalGravityWell

  • isExternalGravityWell(uiNode: UiNode | null): boolean
  • Checks if the UiNode is included in the external gravity well list.

    priv

    none

    Parameters

    • uiNode: UiNode | null

      The UiNode to check.

    Returns boolean

    TRUE if the UiNode is in the list, FALSE if not.

isInLayer

  • isInLayer(a_layer: bigint): boolean
  • Checks to see if node subscribes to the specified node layer.

    priv

    none

    Parameters

    • a_layer: bigint

      The layer to test if this node is a member of.

    Returns boolean

    True if this node subscribes to the specified layer.

isInSubtree

  • isInSubtree(pParent: Node | null): boolean

isSkipRaycast

  • isSkipRaycast(): boolean

isTriggerable

  • isTriggerable(): boolean
  • Returns true if this node should handle trigger presses directly.

    Returns boolean

    true if this node will handle trigger presses directly when focused, false if trigger press will instead enter prism placement mode.

isVisibilityInherited

  • isVisibilityInherited(): boolean

isVisible

  • isVisible(): boolean
  • Returns the visibility state of the node. Note that only the local state is checked, the effect of a parent's visibility is ignored.

    priv

    none

    Returns boolean

    True if the Node is visible.

isVisibleInPrism

  • isVisibleInPrism(): boolean
  • Returns the visibility of the Node in the hierarchy based on self visibility and any potential inherited visibility.

    priv

    none

    Returns boolean

    True if the Node is visible in the Prism.

onActivateSub

onActivateUnsub

  • onActivateUnsub(callbackID: CallbackID): boolean

onCursorEdgeSub

  • onCursorEdgeSub(callback: ((arg0: UiEventData, arg1: Side, arg2: [number, number] | Float32Array, arg3: number) => void) | null): CallbackID
  • The on cursor edge event.

    This event is dispatched when the cursor encounters the Panel shape edge and the Panel is set to constrain cursor movement on the edge side. This event will send the primary side the edge detection occured on, the attempted delta vector of the cursor relative to the edge, and the normalized escape value if a constraint magnitude has been set for the edge side.

    priv

    none

    Parameters

    • callback: ((arg0: UiEventData, arg1: Side, arg2: [number, number] | Float32Array, arg3: number) => void) | null

    Returns CallbackID

onCursorEdgeUnsub

  • onCursorEdgeUnsub(callbackID: CallbackID): boolean

onCursorOffEdgeSub

  • The on cursor off edge event.

    This event is dispatched when the cursor is no longer being constrained by the shape edge. This can occur when the cursor, which had just been constrained by the shape edge, is moved away from the edge towards the interior of the Panel. This can also occur if the side of the shape edge changes while the cursor is being constrained (moving from top to right side for instance).

    This event would be usefull when providing a visual feedback as the cursor attemts to exit a Panel but the user changes their mind and pulls the cursor back to within the Panel, ending the exit attempt.

    priv

    none

    Parameters

    Returns CallbackID

onCursorOffEdgeUnsub

  • onCursorOffEdgeUnsub(callbackID: CallbackID): boolean

onDeletedSub

onDeletedUnsub

onDisabledSub

onDisabledUnsub

  • onDisabledUnsub(callbackID: CallbackID): boolean

onEnabledSub

onEnabledUnsub

onFocusGainedSub

onFocusGainedUnsub

  • onFocusGainedUnsub(callbackID: CallbackID): boolean

onFocusInputSub

onFocusInputUnsub

  • onFocusInputUnsub(callbackID: CallbackID): boolean

onFocusLostSub

onFocusLostUnsub

  • onFocusLostUnsub(callbackID: CallbackID): boolean

onHoverEnterSub

onHoverEnterUnsub

  • onHoverEnterUnsub(callbackID: CallbackID): boolean

onHoverExitSub

onHoverExitUnsub

  • onHoverExitUnsub(callbackID: CallbackID): boolean

onHoverMoveSub

  • onHoverMoveSub(callback: ((arg0: UiEventData, arg1: [number, number, number] | Float32Array) => void) | null): CallbackID

onHoverMoveUnsub

  • onHoverMoveUnsub(callbackID: CallbackID): boolean

onLongPressSub

onLongPressUnsub

  • onLongPressUnsub(callbackID: CallbackID): boolean

onPanelEnterSub

onPanelEnterUnsub

  • onPanelEnterUnsub(callbackID: CallbackID): boolean

onPanelExitSub

onPanelExitUnsub

  • onPanelExitUnsub(callbackID: CallbackID): boolean

onPressedSub

onPressedUnsub

onReleasedSub

onReleasedUnsub

  • onReleasedUnsub(callbackID: CallbackID): boolean

onUpdateSub

onUpdateUnsub

removeChild

  • removeChild(a_pChild: Node | null): void

removeExternalGravityWell

  • removeExternalGravityWell(uiNode: UiNode | null): boolean
  • Removes an external UiNode gravity well from consideration when interacting with this Panel.

    priv

    none

    Parameters

    • uiNode: UiNode | null

      The UiNode to remove from the external gravity well list

    Returns boolean

    TRUE if the removal is successful, FALSE otherwise

removeFromLayer

  • removeFromLayer(a_layer: bigint): void

setAlignment

  • Sets the UiNodes's self alignment relative to Node position.

    Alignment is defined as what side the Node position is in relative to the planar, XY element bounds. A horizontal left alignment would result in the node position being on the left side of the bounds area. A vertical top alignment would result in the node position being on the top side of the bounds area.

    priv

    none

    Parameters

    Returns void

setAnchorPosition

  • setAnchorPosition(a_position: [number, number, number] | Float32Array): void
  • Sets the anchor position of the Node's transform. Rotations, scaling, and translations of the transform will take place around this point. Changing the anchor point will recalculate the transform to the new anchor point.

    priv

    none

    Parameters

    • a_position: [number, number, number] | Float32Array

      Anchor position. This is relative to the default 0,0,0 position of the transform.

    Returns void

setCursorConstrained

  • setCursorConstrained(constrained: boolean): void
  • Sets whether the UiPanel constrains cursor movement within the boundary shape or not.

    The default is false.

    priv

    none

    Parameters

    • constrained: boolean

      flag indicating the cursor is constrained or not.

    Returns void

setCursorHoverState

setCursorInitialPosition

  • setCursorInitialPosition(position: [number, number, number] | Float32Array): void
  • Sets the initial position of the cursor within the Panel upon a Panel-to-Panel transition when PanelCursorTransitionType::kInitialPosition is in affect.

    The position is provided in local Panel space. The default value is (0,0,0).

    priv

    none

    Parameters

    • position: [number, number, number] | Float32Array

      the initial cursor position within Panel space. The provided Z component is ignored and the cursor is positioned at Z=0.

    Returns void

setCursorTransitionType

  • Sets the cursor transition type for the Panel. The cursor transition type dictates where the cursor appears upon a Panel transition, whether closest edge, center, or manually set initial position.

    The default is the initial position.

    priv

    none

    Parameters

    Returns void

setCursorVisible

  • setCursorVisible(visible: boolean): void
  • Sets whether the cursor is visible while inside the UiPanel.

    priv

    none

    Parameters

    • visible: boolean

      the cursor visiblity flag.

    Returns void

setEdgeConstraint

  • setEdgeConstraint(side: Side, constraintMagnitude: number, transitionPanel: UiPanel | null): void
  • setEdgeConstraint(side: Side, constraintMagnitude: number): void
  • Sets the edge constraint and Panel transition properties for a side of the Panel shape.

    Panels that constrain the cursor can also offer the ability for the cursor to escape a side when enough movement is attempted and to also automatically transition to another Panel once the cursor escapes a side.

    priv

    none

    Parameters

    • side: Side

      the Side of the boundary shape to set the properties for.

    • constraintMagnitude: number

      how much the cursor must attempt to move relatively (in scene units) to escape the side. A value less than 0 means no escape possible (always constrained). A value of 0 means the cursor will not be constrained on this side. A value greater than 0 constrains the cursor up to the magnitude.

    • transitionPanel: UiPanel | null

      the optional UiPanel to have the cursor transition to when the cursor escapes. Use nullptr for no transition.

    Returns void

  • Sets the edge constraint for a side of the Panel shape.

    Panels that constrain the cursor can also offer the ability for the cursor to escape a side when enough movement is attempted.

    priv

    none

    Parameters

    • side: Side

      the Side of the boundary shape to set the properties for.

    • constraintMagnitude: number

      how much the cursor must attempt to move relatively (in scene units) to escape the side. A value less than 0 means no escape possible (always constrained). A value of 0 means the cursor will not be constrained on this side. A value greater than 0 constrains the cursor up to the magnitude.

    Returns void

setEdgeConstraintLevel

  • Sets the edge constraint for a side of the Panel shape using a discrete constraint level.

    Panel edge constraint levels are mapped to a float magnitude and can be used for a consistent setting instead of setting the magnitude manually.

    priv

    none

    Parameters

    Returns void

setEdgeTransition

  • setEdgeTransition(side: Side, transitionPanel: UiPanel | null): void
  • Sets the edge transition Panel for a Side.

    Panels that constrain the cursor can also offer the ability for the cursor to escape a side when enough movement is attempted and to also automatically transition to another Panel once the cursor escapes a side.

    priv

    none

    Parameters

    • side: Side

      the Side of the boundary shape to set the properties for.

    • transitionPanel: UiPanel | null

      the UiPanel to have the cursor transition to when the cursor escapes. Use nullptr for no transition.

    Returns void

setEnabled

  • setEnabled(enabled: boolean): void
  • Sets the enabled state

    Disabled UiNodes don't send out certain input events, such as OnPress, OnRelease, OnActivate, etc.

    priv

    none

    Parameters

    • enabled: boolean

      The enabled state of the UiNode.

    Returns void

setEventPassThrough

  • setEventPassThrough(passThrough: boolean): void
  • Sets whether this UiNode passes events through to the next UiNode parent or processes them internally.

    The UI events that will be passed through are the cursor interaction events like onHoverEnter, onHoverExit, and onActivate.

    priv

    none

    Parameters

    • passThrough: boolean

      the event pass through flag.

    Returns void

setEventPassThroughChildren

  • setEventPassThroughChildren(passThrough: boolean): void
  • Sets all descendant UiNodes to either pass through events or not.

    This call is handy if this UiNode potentially has many internal UiNode children in the Node hierarchy but wants all input events to pass through them to be processed and dispatched by this UiNode parent.

    priv

    none

    Parameters

    • passThrough: boolean

      the event pass through flag.

    Returns void

setEventSoundID

  • setEventSoundID(event: SoundEvent, nameID: string): void

setGravityWellEnabled

  • setGravityWellEnabled(enabled: boolean): void

setGravityWellProperties

  • Sets the gravity well properties for this UiNode.

    The default gravity well properties for a UiNode are a sharp cornered rectangular BoundaryShape that matches the UiNode's local AABB that snaps to center of the shape. This should be sufficient in many situations and all that needs to be done to turn on the gravity well for the UiNode is to setGravityWellEnabled(true).

    The default BoundaryShape size is (0,0), which instructs the UiNode to use its own local AABB for the shape size and offset. Setting a size greater than 0 in either X or Y will turn off the automatic use of local AABB and will use the specified size and offset of the BoundaryShape instead. Setting the size back to (0,0) will once again inform the UiNode to use the local AABB for shape parameters.

    priv

    none

    Parameters

    Returns void

setHideBounds

  • setHideBounds(hide: boolean): void

setLocalPosition

  • setLocalPosition(aPos: [number, number, number] | Float32Array): void

setLocalRotation

  • setLocalRotation(aRot: [number, number, number, number] | Float32Array): void

setLocalScale

  • setLocalScale(aScale: [number, number, number] | Float32Array): void

setLocalTransform

  • setLocalTransform(aTransform: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] | Float32Array): void
  • Set the local transform of this Node

    priv

    none

    Parameters

    • aTransform: [number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number] | Float32Array

      transform matrix

    Returns void

setName

  • setName(a_name: string): boolean
  • Set the name of the Node

    By default a Node has no name.

    priv

    none

    Parameters

    • a_name: string

      The new name of the Node.

    Returns boolean

    true if the name of the Node was successfully set, false otherwise.

setOnActivateResponse

setPanelShape

  • Sets the boundary shape for the UiPanel.

    The UiPanel will not be active until the shape is set.

    priv

    none

    Parameters

    Returns void

setParentedBoneName

  • setParentedBoneName(a_boneName: string): boolean
  • Set the bone in the parent by name that this child will attach to This node must have a parent and the parent must be of type ModelNode.

    priv

    none

    Parameters

    • a_boneName: string

      bone name to attach to

    Returns boolean

    true if successful, false if failed

setRenderingLayer

  • setRenderingLayer(a_renderLayer: RenderingLayer): void
  • setRenderingLayer(a_renderLayer: number): void
  • Sets Custom RenderLayer on this UiNode. Which internally sets the render layer on all RenderNode Children

    priv

    none

    Parameters

    • a_renderLayer: RenderingLayer

      Of type uint16_t. Value will be clamped to kRenderingLayerMAX = 999, if more.

      Note: Please use, "render::RenderingLayer" enum to set layers. for eg. RenderNode->setRenderingLayer(render::RenderingLayer::kHUDLayer); or you can also send in the layer value as well eg. RenderNode->setRenderingLayer(static_cast(render::RenderingLayer::kHUDLayer));

      You can also create your own custom layering by using existing layers and your own. eg. uint16_t customHUDLayer1 = static_cast(render::RenderingLayer::kHUDLayer) + 1; uint16_t customHUDLayer2 = static_cast(render::RenderingLayer::kHUDLayer) + 2; uint16_t customHUDLayer3 = static_cast(render::RenderingLayer::kHUDLayer) + 3;

    Returns void

  • Sets Custom RenderLayer on this UiNode. Which internally sets the render layer on all RenderNode Children

    priv

    none

    Parameters

    • a_renderLayer: number

      Of type uint16_t. Value will be clamped to kRenderingLayerMAX = 999, if more.

    Returns void

setSkipRaycast

  • setSkipRaycast(a_skipRaycast: boolean, a_propagateToChildren?: boolean): void
  • Sets the skip raycast state of the node.

    priv

    none

    Parameters

    • a_skipRaycast: boolean

      Raycast skip flag.

    • Optional a_propagateToChildren: boolean

      default = false
      Flag to also set the raycast state of any children

    Returns void

setTriggerable

  • setTriggerable(a_triggerable: boolean): void
  • Sets whether this node should handle trigger presses directly.

    priv

    none

    Parameters

    • a_triggerable: boolean

      true if this node should handle trigger presses directly when focused, false if trigger press should instead enter prism placement mode.

    Returns void

setVisibilityInherited

  • setVisibilityInherited(a_inherit: boolean): void
  • Flags that the visibility state of this node should be inherited by its children. This does not change a child's visibility set by setVisible. A visibility of false will take precedence over a visibility of true. The tables below show the draw result for various combinations of node visibility and inheritance.

             visible     inherit     drawn
    node  :   false       true        no
    child :   true          x         no
    
             visible     inherit     drawn
    node  :   false       false       no
    child :   true          x         yes
    
             visible     inherit     drawn
    node  :   true        true        yes
    child :   false         x         no
    
             visible     inherit     drawn
    node  :   true        false       yes
    child :   false         x         no
    priv

    none

    Parameters

    • a_inherit: boolean

      Flag that this node's children should inherit its visibility.

    Returns void

setVisible

  • setVisible(a_visible: boolean, a_propagateToChildren?: boolean): void
  • Sets the visibility state of the node.

    priv

    none

    Parameters

    • a_visible: boolean

      Visibility flag

    • Optional a_propagateToChildren: boolean

      default = false
      Flag to also set the visibility state of any children

    Returns void

stopTransformAnimations

  • stopTransformAnimations(): void

updateLayout

  • updateLayout(): void

Static Create

Static Delete

  • Delete(node: Node | null): void
  • Client-side only: this static function is used to delete a node with its Prism's deleteNode function.

    priv

    none

    Parameters

    • node: Node | null

      is the node to delete

    Returns void

Static RequestFocus

  • RequestFocus(pUiNode: UiNode | null): void

Generated using TypeDoc