traviso.js - v0.1.12
    Preparing search index...

    Class ObjectView

    Visual class for the map-objects.

    ObjectView

    Hierarchy

    • Container
      • ObjectView
    Index

    Constructors

    • Visual class constructor for the map-objects.

      Parameters

      • engine: EngineView

        {EngineView} the engine instance that the map-object sits in, required

      • type: string

        {number} type-id of the object as defined in the JSON file

      • animSpeed: number = 0.5

        {number} animation speed for the animated visuals, default 0.5

      Returns ObjectView

    Properties

    columnSpan: number

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

    currentDirection: TDirection

    Current direction of the object.

    currentInteractionOffset: TColumnRowPair

    Interaction offset points for the active visual.

    isFloorObject: boolean

    Defines if the object is a floor object or not

    isInteractive: boolean

    Defines if the map-object is interactive/selectable.

    isMovableTo: boolean

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

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

    noTransparency: boolean

    If true doesn't allow transparency change on this object

    rowSpan: number

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

    type: string

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

    Accessors

    • get animSpeed(): number

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

      Returns number

      0.5
      
    • set animSpeed(value: number): void

      Parameters

      • value: number

      Returns void

    Methods

    • Function Internal

      Changes the map-object's texture(s) according to the specified visual-id.

      Parameters

      • vId: string

        {string} visual-id

      • stopOnFirstFrame: boolean = false

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

      • noLoop: boolean = false

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

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

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

      • animSpeed: number = null

        {number} 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

    • Function

      Changes the map-object's texture(s) according to the specified direction-id and the state of the map-object (moving or stationary).

      Parameters

      • direction: TDirection

        {TDirection} direction-id as defined in TRAVISO.DIRECTIONS

      • moving: boolean = false

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

      • stopOnFirstFrame: boolean = false

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

      • noLoop: boolean = false

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

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

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

      • animSpeed: number = null

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

      Returns void

    • Function

      Clears all references.

      Returns void