Preparing search index...

    The Visual abstract class serves as a base class for creating visual components with customizable states, animations, and interactions. It provides a framework for managing visual properties such as color, scale, and position states.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _defaultColor: vec4 = COLORS.darkGray
    _errorColor: vec4 = ERROR_COLOR
    _hoveredColor: vec4 = COLORS.brightYellow
    _inactiveColor: vec4 = INACTIVE_COLOR
    _sceneObject: SceneObject
    _state: VisualState = undefined
    _toggledDefaultColor: vec4 = ...
    _toggledHoveredColor: vec4 = ...
    _toggledTriggeredColor: vec4 = ...
    _transform: Transform
    _triggeredColor: vec4 = ...
    _visualComponent: ScriptComponent
    initialized: boolean = false
    managedComponents: Component[] = []
    needsVisualStateUpdate: boolean = true
    onDestroyed: PublicApi<void> = ...
    onInitialized: PublicApi<void> = ...
    onPositionChanged: PublicApi<ScaleChangeArgs> = ...
    onScaleChanged: PublicApi<ScaleChangeArgs> = ...
    prevState: VisualState = undefined
    visualArgs: VisualArgs

    Accessors

    • get animateDuration(): number

      Gets the duration of the animation.

      Returns number

      The duration of the animation in milliseconds.

    • set animateDuration(animateDuration: number): void

      Sets the duration of the animation.

      Parameters

      • animateDuration: number

        The duration of the animation in milliseconds.

      Returns void

    • get baseColor(): vec4

      Returns vec4

    • set baseColor(value: vec4): void

      Parameters

      Returns void

    • get baseDefaultColor(): vec4

      Gets the default base color for the visual element.

      Returns vec4

      A vec4 representing the current base default color.

    • set baseDefaultColor(baseDefaultColor: vec4): void

      Sets the default base color for the visual element.

      Parameters

      • baseDefaultColor: vec4

        A vec4 representing the RGBA color to be used as the default.

      Returns void

    • get baseErrorColor(): vec4

      Gets the error color for the visual element.

      Returns vec4

      A vec4 representing the current error color.

    • set baseErrorColor(baseErrorColor: vec4): void

      Sets the error color for the visual element.

      Parameters

      • baseErrorColor: vec4

        A vec4 representing the RGBA color to be used as the error color.

      Returns void

    • get baseHoveredColor(): vec4

      Gets the hovered color for the visual element.

      Returns vec4

      A vec4 representing the current hovered color.

    • set baseHoveredColor(baseHoveredColor: vec4): void

      Sets the hovered color for the visual element.

      Parameters

      • baseHoveredColor: vec4

      Returns void

      A vec4 representing the current base hovered color.

    • get baseInactiveColor(): vec4

      Gets the inactive color for the visual element.

      Returns vec4

      A vec4 representing the current inactive color.

    • set baseInactiveColor(baseInactiveColor: vec4): void

      Sets the inactive color for the visual element.

      Parameters

      • baseInactiveColor: vec4

        A vec4 representing the RGBA color to be used as the inactive color.

      Returns void

    • get baseToggledDefaultColor(): vec4

      Gets the toggled default color for the visual element.

      Returns vec4

      A vec4 representing the current toggled default color.

    • set baseToggledDefaultColor(baseToggledDefaultColor: vec4): void

      Sets the toggled default color for the visual element.

      Parameters

      • baseToggledDefaultColor: vec4

        A vec4 representing the RGBA color to be used as the toggled default color.

      Returns void

    • get baseToggledHoveredColor(): vec4

      Gets the toggled hovered color for the visual element.

      Returns vec4

      A vec4 representing the current toggled hovered color.

    • set baseToggledHoveredColor(baseToggledHoveredColor: vec4): void

      Sets the toggled hovered color for the visual element.

      Parameters

      • baseToggledHoveredColor: vec4

        A vec4 representing the RGBA color to be used as the toggled hovered color.

      Returns void

    • get baseToggledTriggeredColor(): vec4

      Gets the toggled triggered color for the visual element.

      Returns vec4

      A vec4 representing the current toggled triggered color.

    • set baseToggledTriggeredColor(baseToggledTriggeredColor: vec4): void

      Sets the toggled triggered color for the visual element.

      Parameters

      • baseToggledTriggeredColor: vec4

        A vec4 representing the RGBA color to be used as the toggled triggered color.

      Returns void

    • get baseTriggeredColor(): vec4

      Gets the triggered color for the visual element.

      Returns vec4

      A vec4 representing the current triggered color.

    • set baseTriggeredColor(baseTriggeredColor: vec4): void

      Gets the triggered color for the visual element.

      Parameters

      • baseTriggeredColor: vec4

      Returns void

      A vec4 representing the current triggered color.

    • get borderSize(): number

      Returns number

    • get defaultPosition(): vec3

      Gets the default position of the visual element.

      Returns vec3

      A vec3 representing the current default position.

    • set defaultPosition(position: vec3): void

      Sets the default position of the visual element.

      Parameters

      • position: vec3

        A vec3 object representing the new default position.

      Returns void

    • get defaultScale(): vec3

      Gets the default scale of the visual element.

      Returns vec3

      A vec3 representing the current default scale.

    • set defaultScale(scale: vec3): void

      Sets the default scale of the visual and initializes its visual states.

      Parameters

      • scale: vec3

        A vec3 object representing the default scale to be applied.

      Returns void

    • get defaultShouldPosition(): boolean

      Gets whether the default state should apply position changes.

      Returns boolean

      true if the default state should apply position changes; otherwise, false.

    • set defaultShouldPosition(shouldPosition: boolean): void

      Sets whether the default state should apply position changes and initializes the visual states.

      Parameters

      • shouldPosition: boolean

        A boolean indicating whether the default state should apply position changes.

      Returns void

    • get defaultShouldScale(): boolean

      Gets whether the default state should apply scale changes.

      Returns boolean

      true if the default state should apply scale changes; otherwise, false.

    • set defaultShouldScale(shouldScale: boolean): void

      Sets whether the default state should apply scale changes and initializes the visual states.

      Parameters

      • shouldScale: boolean

        A boolean indicating whether the default state should apply scale changes.

      Returns void

    • get errorPosition(): vec3

      Gets the position of the visual element when it is in an error state.

      Returns vec3

      A vec3 representing the current error position.

    • set errorPosition(position: vec3): void

      Sets the position of the visual element when it is in an error state.

      Parameters

      • position: vec3

        A vec3 object representing the new position for the error state.

      Returns void

    • get errorScale(): vec3

      Gets the scale applied when the visual is in an error state.

      Returns vec3

      A vec3 representing the current error scale.

    • set errorScale(scale: vec3): void

      Sets the scale for the error visualization and initializes its visual states.

      Parameters

      • scale: vec3

        A vec3 object representing the scale to be applied to the error visualization.

      Returns void

    • get hasBorder(): boolean

      Returns boolean

    • get hoveredPosition(): vec3

      Gets the hovered position of the visual element.

      Returns vec3

      A vec3 representing the current hovered position.

    • set hoveredPosition(hoveredPosition: vec3): void

      Gets the hovered position of the visual element.

      Parameters

      • hoveredPosition: vec3

      Returns void

      A vec3 representing the new hovered position.

    • get hoveredScale(): vec3

      Gets the hovered scale of the visual element.

      Returns vec3

      A vec3 representing the current hovered scale.

    • set hoveredScale(hoveredScale: vec3): void

      Sets the hovered scale for the visual element and initializes its visual states.

      Parameters

      • hoveredScale: vec3

        A vec3 object representing the hovered scale to be applied.

      Returns void

    • get hoveredShouldPosition(): boolean

      Gets whether the hover state should apply position changes.

      Returns boolean

      true if the hovered state should apply position changes; otherwise, false.

    • set hoveredShouldPosition(hoveredShouldPosition: boolean): void

      Sets whether the hovered state should apply position changes and initializes the visual states.

      Parameters

      • hoveredShouldPosition: boolean

        A boolean indicating whether the hovered state should apply position changes.

      Returns void

    • get hoveredShouldScale(): boolean

      Gets whether the hovered state should apply scale changes.

      Returns boolean

      true if the hovered state should apply scale changes; otherwise, false.

    • set hoveredShouldScale(hoveredShouldScale: boolean): void

      Sets whether the hovered state should apply scale changes and initializes the visual states.

      Parameters

      • hoveredShouldScale: boolean

        A boolean indicating whether the hovered state should apply scale changes.

      Returns void

    • get inactivePosition(): vec3

      Gets the position of the visual element when it is in a inactive state.

      Returns vec3

      A vec3 representing the current inactive position.

    • set inactivePosition(position: vec3): void

      Sets the position of the visual element when it is in a inactive state.

      Parameters

      • position: vec3

        A vec3 object representing the new position for the inactive state.

      Returns void

    • get inactiveScale(): vec3

      Gets the scale applied when the visual is in a inactive state.

      Returns vec3

      A vec3 representing the current inactive scale.

    • set inactiveScale(scale: vec3): void

      Sets the scale to be applied when the visual is in a inactive state and initializes its visual states.

      Parameters

      • scale: vec3

        A vec3 object representing the scale to apply in the inactive state.

      Returns void

    • get inactiveShouldPosition(): boolean

      Gets whether the inactive state should apply position changes.

      Returns boolean

      true if the inactive state should apply position changes; otherwise, false.

    • set inactiveShouldPosition(shouldPosition: boolean): void

      Sets whether the inactive state should apply position changes and initializes the visual states.

      Parameters

      • shouldPosition: boolean

        A boolean indicating whether the inactive state should apply position changes.

      Returns void

    • get inactiveShouldScale(): boolean

      Gets whether the inactive state should apply scale changes.

      Returns boolean

      true if the inactive state should apply scale changes; otherwise, false.

    • set inactiveShouldScale(shouldScale: boolean): void

      Sets whether the inactive state should apply scale changes and initializes the visual states.

      Parameters

      • shouldScale: boolean

        A boolean indicating whether the inactive state should apply scale changes.

      Returns void

    • get sceneObject(): SceneObject

      Gets the associated SceneObject instance.

      Returns SceneObject

      The SceneObject associated with this visual.

    • get shouldColorChange(): boolean

      Determines whether the color should change when transition to a new state.

      Returns boolean

      A boolean value indicating if the color change is enabled.

    • set shouldColorChange(shouldColorChange: boolean): void

      Sets whether to enable the color changing behavior for the visual.

      Parameters

      • shouldColorChange: boolean

        A boolean indicating whether the color change is enabled (true) or disabled (false).

      Returns void

    • get shouldScale(): boolean

      Determines whether the visual element should scale when transitioning to a new state

      Returns boolean

      true if the visual element should scale, otherwise false.

    • get shouldTranslate(): boolean

      Indicates whether the visual element should be translated when transitioning to a new state.

      Returns boolean

      true if the visual element should be translated; otherwise, false.

    • get size(): vec3

      Gets the size of the visual element.

      Returns vec3

      A vec3 representing the dimensions of the visual element.

    • set size(size: vec3): void

      Sets the size of the visual element. Updates both the internal _size property.

      Parameters

      • size: vec3

        A vec3 object representing the dimensions of the visual element.

      Returns void

    • get toggledDefaultShouldPosition(): boolean

      Gets whether the toggled default state should apply position changes.

      Returns boolean

      true if the toggled default state should apply position changes; otherwise, false.

    • set toggledDefaultShouldPosition(shouldPosition: boolean): void

      Sets whether the toggled default state should apply position changes and initializes the visual states.

      Parameters

      • shouldPosition: boolean

        A boolean indicating whether the toggled default state should apply position changes.

      Returns void

    • get toggledDefaultShouldScale(): boolean

      Gets whether the toggled default state should apply scale changes.

      Returns boolean

      true if the toggled default state should apply scale changes; otherwise, false.

    • set toggledDefaultShouldScale(shouldScale: boolean): void

      Sets whether the toggled default state should apply scale changes and initializes the visual states.

      Parameters

      • shouldScale: boolean

        A boolean indicating whether the toggled default state should apply scale changes.

      Returns void

    • get toggledHoveredPosition(): vec3

      Gets the toggled hovered position for the visual element.

      Returns vec3

      A vec3 representing the current toggled hovered position.

    • set toggledHoveredPosition(toggledHoveredPosition: vec3): void

      Sets the toggled hovered position for the visual element.

      Parameters

      • toggledHoveredPosition: vec3

        A vec3 object representing the new toggled hovered position.

      Returns void

    • get toggledHoveredScale(): vec3

      Gets the toggled hovered scale of the visual element.

      Returns vec3

      A vec3 representing the current toggled hovered scale.

    • set toggledHoveredScale(toggledHoveredScale: vec3): void

      Sets the scale to be applied when the visual is toggled and hovered.

      Parameters

      • toggledHoveredScale: vec3

        A vec3 representing the new scale to apply when toggled and hovered.

      Returns void

    • get toggledHoveredShouldPosition(): boolean

      Gets whether the toggled hovered state should apply position changes.

      Returns boolean

      true if the toggled hovered state should apply position changes; otherwise, false.

    • set toggledHoveredShouldPosition(toggledHoveredShouldPosition: boolean): void

      Sets whether the toggled hovered state should apply position changes and initializes the visual states.

      Parameters

      • toggledHoveredShouldPosition: boolean

        A boolean indicating whether the toggled hovered state should apply position changes.

      Returns void

    • get toggledHoveredShouldScale(): boolean

      Gets whether the toggled hovered state should apply scale changes.

      Returns boolean

      true if the toggled hovered state should apply scale changes; otherwise, false.

    • set toggledHoveredShouldScale(toggledHoveredShouldScale: boolean): void

      Sets whether the toggled hovered state should apply scale changes and initializes the visual states.

      Parameters

      • toggledHoveredShouldScale: boolean

        A boolean indicating whether the toggled hovered state should apply scale changes.

      Returns void

    • get toggledPosition(): vec3

      Gets the toggled position of the visual element.

      Returns vec3

      A vec3 representing the current toggled position.

    • set toggledPosition(position: vec3): void

      Sets the toggled position of the visual element.

      Parameters

      • position: vec3

        A vec3 object representing the new toggled position.

      Returns void

    • get toggledScale(): vec3

      Gets the toggled scale of the visual element.

      Returns vec3

      A vec3 representing the current toggled scale.

    • set toggledScale(scale: vec3): void

      Sets the scale to be applied when the visual is toggled and initializes its visual states.

      Parameters

      • scale: vec3

        A vec3 representing the new scale to apply when toggled.

      Returns void

    • get toggledTriggeredPosition(): vec3

      Gets the toggled triggered position of the visual element.

      Returns vec3

      A vec3 representing the current toggled triggered position.

    • set toggledTriggeredPosition(position: vec3): void

      Sets the toggled triggered position of the visual element.

      Parameters

      • position: vec3

        A vec3 object representing the new toggled triggered position.

      Returns void

    • get toggledTriggeredScale(): vec3

      Gets the toggled triggered scale of the visual element.

      Returns vec3

      A vec3 representing the current toggled triggered scale.

    • set toggledTriggeredScale(scale: vec3): void

      Sets the toggled triggered scale of the visual element.

      Parameters

      • scale: vec3

        A vec3 object representing the new toggled triggered scale.

      Returns void

    • get toggledTriggeredShouldPosition(): boolean

      Gets whether the toggled triggered state should apply position changes.

      Returns boolean

      true if the toggled triggered state should apply position changes; otherwise, false.

    • set toggledTriggeredShouldPosition(shouldPosition: boolean): void

      Sets whether the toggled triggered state should apply position changes and initializes the visual states.

      Parameters

      • shouldPosition: boolean

        A boolean indicating whether the toggled triggered state should apply position changes.

      Returns void

    • get toggledTriggeredShouldScale(): boolean

      Gets whether the toggled triggered state should apply scale changes.

      Returns boolean

      true if the toggled triggered state should apply scale changes; otherwise, false.

    • set toggledTriggeredShouldScale(shouldScale: boolean): void

      Sets whether the toggled triggered state should apply scale changes and initializes the visual states.

      Parameters

      • shouldScale: boolean

        A boolean indicating whether the toggled triggered state should apply scale changes.

      Returns void

    • get transform(): Transform

      Gets the transform associated with this visual.

      Returns Transform

      The current transform of the visual.

    • get triggeredPosition(): vec3

      Gets the triggered position of the visual element.

      Returns vec3

      A vec3 representing the current triggered position.

    • set triggeredPosition(position: vec3): void

      Sets the triggered position of the visual element.

      Parameters

      • position: vec3

        A vec3 object representing the new triggered position.

      Returns void

    • get triggeredScale(): vec3

      Gets the triggered scale of the visual element.

      Returns vec3

      A vec3 representing the current triggered scale.

    • set triggeredScale(scale: vec3): void

      Sets the triggered scale of the visual and initializes its visual states.

      Parameters

      • scale: vec3

        A vec3 representing the scale to be applied to the visual.

      Returns void

    • get triggeredShouldPosition(): boolean

      Gets whether the triggered state should apply position changes.

      Returns boolean

      true if the triggered state should apply position changes; otherwise, false.

    • set triggeredShouldPosition(shouldPosition: boolean): void

      Sets whether the triggered state should apply position changes and initializes the visual states.

      Parameters

      • shouldPosition: boolean

        A boolean indicating whether the triggered state should apply position changes.

      Returns void

    • get triggeredShouldScale(): boolean

      Gets whether the triggered state should apply scale changes.

      Returns boolean

      true if the triggered state should apply scale changes; otherwise, false.

    • set triggeredShouldScale(shouldScale: boolean): void

      Sets whether the triggered state should apply scale changes and initializes the visual states.

      Parameters

      • shouldScale: boolean

        A boolean indicating whether the triggered state should apply scale changes.

      Returns void

    Methods

    • Destroys the current instance.

      Returns void

    • Returns void

    • Returns void

    • Initializes the visual component by setting up its initial scale and position, and preparing its visual states. This method is typically called during the setup phase to ensure the visual component is ready for use.

      Returns void

    • Updates the visual state of the object based on the provided state type.

      Parameters

      • stateName: StateName

        The type of state to set, which determines the visual properties such as color, scale, and position.

      Returns void

    • Parameters

      Returns void

    • Returns void