dot big bang

Developer API
Menu

Class UIVoxelObjectElement

All
  • Public
  • Public/Protected
  • All

Hierarchy

Index

Methods

getColor

  • Get the the tint color of the voxel object being displayed by this element.

    Parameters

    • Optional optionalTarget: Color

      If provided, returns the color into this object rather than allocating a new one.

    Returns Color

getDepth

  • getDepth(): number
  • Get the depth of the element, a larger number is further into the screen and elements with a smaller number will appear on top.

    Returns number

getExtents

  • Gets the 2d size of the element in normalized coordinates, also known as UI-position units. For example, a size of (0.5, 1) would indicate an element that covers half the screen horizontally and the whole screen vertically.

    Parameters

    Returns Vector2

getOpacity

  • getOpacity(): number
  • Returns the opacity level, between 0 (fully transparent, i.e invisible) and 1 (fully opaque), at which the VoxelObject is rendered

    Returns number

getPlaybackRate

  • getPlaybackRate(): number
  • Returns the rate at which the VoxelObject animation is played (or would be played, if isPlaying() is false). A rate of 1 means that the animation is played at its default speed as intended by its author, while a rate of 0.5 is half speed, a rate of 2 is twice the speed, etc... A negative value plays the animation backwards.

    Returns number

getPosition

  • Returns the position in UI-position units of the element.

    Parameters

    • Optional optionalTarget: Vector2

      If provided, return the position in this object rather than allocating a new one.

    Returns Vector2

getRotation

  • getRotation(): number

getSize

  • getSize(): number
  • Gets the size of the element in UI-size units. Note that it is not recommended to use this in combination with setSize2D.

    Returns number

getSize2D

  • Gets the 2d size of the element in UI-size units. For example, a size of (2, 1) would indicate an element that has the default height and twice the default width.

    Parameters

    Returns Vector2

getTime

  • getTime(): number
  • Returns the current time position in the VoxelObject animation, in seconds.

    Returns number

getVoxelObject

  • Returns the VoxelObject this element is displaying.

    Returns VoxelObject

isPlaying

  • isPlaying(): boolean
  • Indicates whether this VoxelObject element is playing the VoxelObject animation.

    Returns boolean

isVisible

  • isVisible(): boolean
  • Indicates whether this element is visible or not.

    Returns boolean

play

  • play(value: boolean): void
  • Sets whether the VoxelObject displayed by this element should be played (i.e. animated).

    Parameters

    • value: boolean

      Use true to play the VoxelObject animation, false to keep it static, in which case, setTime() dictactes which frame of the animation is showed.

    Returns void

setColor

  • setColor(color: Color): void
  • Sets the tint color of the voxel object displayed by this element.

    Parameters

    Returns void

setDepth

  • setDepth(depth: number): void
  • Set the depth of the UIElement, a larger number is further into the screen and elements with a smaller number will appear on top.

    Parameters

    • depth: number

      The depth layer to place the element on.

    Returns void

setExtents

  • Sets the 2d size of the element in normalized coordinates, also known as UI-position units. For example, a size of (0.5, 1) would indicate an element that covers half the screen horizontally and the whole screen vertically. Note: this will affect the same internal state as setSize. Note: If the window/canvas changes size, you will need to call this again.

    Parameters

    Returns Vector2

setOpacity

  • setOpacity(value: number): any
  • Sets the opacity level, between 0 (fully transparent, i.e invisible) and 1 (fully opaque), at which the VoxelObject is rendered. This is used to make the VoxelObject see-through.

    Parameters

    • value: number

      The opacity level between 0 and 1.

    Returns any

setPlaybackRate

  • setPlaybackRate(value: number): void
  • Sets the rate at which the VoxelObject animation is played. This has no effect if the isPlaying() is false. A rate of 1 means that the animation is played at its default speed as intended by its author, while a rate of 0.5 is half speed, a rate of 2 is twice the speed, etc... A negative value plays the animation backwards.

    Parameters

    • value: number

    Returns void

setPosition

  • setPosition(position: Vector2): void
  • Sets the position of this element, in UI-position units.

    Parameters

    • position: Vector2

      The position, in UI-position units.

    Returns void

setRotation

  • setRotation(angle: number): void
  • Set the rotation in radians.

    Parameters

    • angle: number

    Returns void

setSize

  • setSize(size: number): void
  • Sets the size of the element in UI-size units. This will make the element uniformly scaled on both the X and Y axis.

    Parameters

    • size: number

    Returns void

setSize2D

  • Sets the 2d size of the element in UI-size units. For example, a size of (2, 1) would indicate an element that has the default height and twice the default width. Passing in (1, 1) is equivalent to calling setSize(1).

    Parameters

    Returns void

setTime

  • setTime(value: number): void
  • Set the time position in the VoxelObject animation, in seconds.

    Parameters

    • value: number

    Returns void

setVisible

  • setVisible(visible: boolean): void
  • Sets the visibility of the element (i.e. hide or show) in the UI.

    Parameters

    • visible: boolean

      Use true to show the element or false to hide it.

    Returns void

setVoxelObject

  • Sets the voxel object.

    Parameters

    Returns void

showVoxelFrameAtKey

  • showVoxelFrameAtKey(keyIndex: number): void
  • Updates the time of this element so it displays the VoxelObject frame at the animation key specified by its index. If the index is negative the first key is used. If it's greater than the number of keys, the last key is used.

    Parameters

    • keyIndex: number

      The index of the animation key in the VoxelObject sequence which frame we want to display.

    Returns void