Options
All
  • Public
  • Public/Protected
  • All
Menu

Visual class for the map-objects.

Hierarchy

  • Container
    • ObjectView

Index

Constructors

constructor

  • Visual class constructor for the map-objects.

    Parameters

    • engine: EngineView

      the engine instance that the map-object sits in, required

    • type: string

      type-id of the object as defined in the JSON file

    • animSpeed: number = 0.5

      animation speed for the animated visuals, default 0.5

    Returns ObjectView

Properties

Private _container

_container: AnimatedSprite

Defines if the map-object is movable onto by other map-objects.

property
internal

Private _engine

_engine: EngineView

A reference to the engine view that the map-object sits in.

property

{EngineView} engine

internal

Private _interactionOffsets

_interactionOffsets: ObjectInfoInteractionOffsets

A dictionary for interaction offset points for each visual if defined in the map data file.

property

Private _textures

_textures: ObjectInfoTextures

A dictionary for all the textures defined for the map-object.

property

columnSpan

columnSpan: number

Number of tiles that map-object covers horizontally on the isometric map

property

currentDirection

currentDirection: TDirection

Current direction of the object.

property

currentInteractionOffset

currentInteractionOffset: TColumnRowPair

Interaction offset points for the active visual.

property

isFloorObject

isFloorObject: boolean

Defines if the object is a floor object or not

property

isInteractive

isInteractive: boolean

Defines if the map-object is interactive/selectable.

property

isMovableTo

isMovableTo: boolean

Defines if the map-object is movable onto by other map-objects.

property

mapPos

Position of the object in terms of column and row index.

property

noTransparency

noTransparency: boolean

If true doesn't allow transparency change on this object

property

Private onContainerAnimCompleteCallback

onContainerAnimCompleteCallback: (objectView: ObjectView) => unknown
property
function
internal

Type declaration

Private onContainerAnimComplete_binded

onContainerAnimComplete_binded: () => void
property
function
internal

Type declaration

    • (): void
    • Returns void

Private onContainerAnimComplete_delayed_binded

onContainerAnimComplete_delayed_binded: () => void
property
function
internal

Type declaration

    • (): void
    • Returns void

rowSpan

rowSpan: number

Number of tiles that map-object covers vertically on the isometric map

property

type

type: string

Type-id of the map-object as defined in the json file.

property

Accessors

animSpeed

  • get animSpeed(): number
  • set animSpeed(value: number): void
  • Animation speed for the animated visuals included in the map-object visuals.

    property
    default

    0.5

    Returns number

  • Animation speed for the animated visuals included in the map-object visuals.

    Parameters

    • value: number

    Returns void

Methods

changeVisual

  • changeVisual(vId: string, stopOnFirstFrame?: boolean, noLoop?: boolean, onAnimComplete?: (objectView: ObjectView) => unknown, animSpeed?: number): boolean
  • Changes the map-object's texture(s) according to the specified visual-id.

    method
    function
    internal

    Parameters

    • vId: string

      visual-id

    • stopOnFirstFrame: boolean = false

      if true stops on the first frame after changing the visuals, default false

    • noLoop: boolean = false

      if true the animation will not loop after the first run, default false

    • onAnimComplete: (objectView: ObjectView) => unknown = null

      callback function to call if 'noLoop' is true after the first run of the animation, default null

    • animSpeed: number = null

      animation speed for the animated visuals, stays the same if not defined, default null

    Returns boolean

    true if the visual-id was valid and the visual has changed without errors

changeVisualToDirection

  • changeVisualToDirection(direction: TDirection, moving?: boolean, stopOnFirstFrame?: boolean, noLoop?: boolean, onAnimComplete?: (objectView: ObjectView) => unknown, animSpeed?: number): void
  • Changes the map-object's texture(s) according to the specified direction-id and the state of the map-object (moving or stationary).

    method
    function

    Parameters

    • direction: TDirection

      direction-id as defined in TRAVISO.DIRECTIONS

    • moving: boolean = false

      if the requested visuals are for moving or stationary state, default false

    • stopOnFirstFrame: boolean = false

      if true stops on the first frame after changing the visuals, default false

    • noLoop: boolean = false

      if true the animation will not loop after the first run, default false

    • onAnimComplete: (objectView: ObjectView) => unknown = null

      callback function to call if 'noLoop' is true after the first run of the animation, default null

    • animSpeed: number = null

      animation speed for the animated visuals, stays the same if not defined, default null

    Returns void

destroy

  • destroy(): void
  • Clears all references.

    method
    function

    Returns void

Private onContainerAnimComplete

  • onContainerAnimComplete(): void

Private onContainerAnimComplete_delayed

  • onContainerAnimComplete_delayed(): void