Options
All
  • Public
  • Public/Protected
  • All
Menu

Main PIXI.Container class to hold all views within the engine and all map related logic.

Hierarchy

  • Container
    • EngineView

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Constructor method for the main PIXI.Container class to hold all views within the engine and all map related logic.

    Parameters

    Returns EngineView

Properties

Private _bg

_bg: Graphics

Solid colored background

property
internal

Private _config

Internal property holding the engine configuration.

property
internal

Private _currentControllable

_currentControllable: ObjectView

Current controllable map-object that will be the default object to move in user interactions

property
internal

Private _currentFocusLocation

_currentFocusLocation: TColumnRowPair
property
internal

Private _currentScale

_currentScale: number

Current scale of the map's display object

property
internal

Private _currentZoom

_currentZoom: number

Current zoom amount of the map

property
internal

Private _dragInitStartingX

_dragInitStartingX: number
property
internal

Private _dragInitStartingY

_dragInitStartingY: number
property
internal

Private _dragPrevStartingX

_dragPrevStartingX: number
property
internal

Private _dragPrevStartingY

_dragPrevStartingY: number
property
internal

Private _dragging

_dragging: boolean = false
default

false

property
internal

Private _externalCenter

_externalCenter: TPositionPair

Active external center point for the engine.

property
internal

Private _groundContainer

_groundContainer: Container

Display object for the ground/terrain visuals

property
internal

Private _mapContainer

_mapContainer: Container

Display object for the map visuals

property
internal

Private _mapMask

_mapMask: Graphics

Mask graphics for the mask

property
internal

Private _mapSizeC

_mapSizeC: number

Number of columns in the isometric map

property
internal

Private _mapSizeR

_mapSizeR: number

Number of rows in the isometric map

property
internal

Private _mapVertices

_mapVertices: number[][]

Vertices of the map

property
internal

Private _mapVisualHeightReal

_mapVisualHeightReal: number

Total height of all ground tiles

property
internal

Private _mapVisualWidthReal

_mapVisualWidthReal: number

Total width of all ground tiles

property
internal

Private _mapVisualWidthScaled

_mapVisualWidthScaled: number
property
internal

Private _objArray

_objArray: ObjectView[][][]

Array to hold map-objects

property
internal

Private _objContainer

_objContainer: Container

Display object for the map-object visuals

property
internal

Private _pathFinding

_pathFinding: PathFinding

PathFinding instance to handle all path finding logic

property
internal

Private _posFrame

_posFrame: TPositionFrame = ...

Active position frame for the engine.

property
internal

Private _tileArray

_tileArray: TileView[][]

Array to hold map-tiles

property
internal

mapData

mapData: TMapData

Variable holding the parsed and processed map data

property

moveEngine

moveEngine: MoveEngine

MoveEngine instance to handle all animations and tweens

property

Private onMouseDown_binded

onMouseDown_binded: (event: InteractionEvent) => void
property
internal

Type declaration

    • (event: InteractionEvent): void
    • Parameters

      • event: InteractionEvent

      Returns void

Private onMouseMove_binded

onMouseMove_binded: (event: InteractionEvent) => void
property
internal

Type declaration

    • (event: InteractionEvent): void
    • Parameters

      • event: InteractionEvent

      Returns void

Private onMouseUp_binded

onMouseUp_binded: (event: InteractionEvent) => void
property
internal

Type declaration

    • (event: InteractionEvent): void
    • Parameters

      • event: InteractionEvent

      Returns void

Readonly tileHalfHeight

tileHalfHeight: number

Half-height of a single isometric tile

default

37

property

Readonly tileHalfWidth

tileHalfWidth: number

Half-width of a single isometric tile

default

64

property

Static Private Readonly DEFAULT_ISO_ANGLE

DEFAULT_ISO_ANGLE: number = 30

The default angle (in degrees) between the top-left edge and the horizontal diagonal of a isometric quad

default

30

property
static

Static Private Readonly DEFAULT_TILE_H

DEFAULT_TILE_H: number = 74

The default height of a single isometric tile

default

74

property
static

Accessors

changeTransparencies

  • get changeTransparencies(): boolean
  • set changeTransparencies(value: boolean): void
  • make objects transparent when the controllable is behind them

    property
    default

    true

    Returns boolean

  • make objects transparent when the controllable is behind them

    Parameters

    • value: boolean

    Returns void

checkPathOnEachTile

  • get checkPathOnEachTile(): boolean
  • set checkPathOnEachTile(value: boolean): void
  • Engine looks for a path every time an object moves to a new tile on the path (set to false if you don't have moving objects other then your controllable on your map)

    property
    default

    true

    Returns boolean

  • Engine looks for a path every time an object moves to a new tile on the path (set to false if you don't have moving objects other then your controllable on your map)

    Parameters

    • value: boolean

    Returns void

dontAutoMoveToTile

  • get dontAutoMoveToTile(): boolean
  • set dontAutoMoveToTile(value: boolean): void
  • When a tile selected don't move the controllable immediately but still call 'tileSelectCallback'

    property
    default

    false

    Returns boolean

  • When a tile selected don't move the controllable immediately but still call 'tileSelectCallback'

    Parameters

    • value: boolean

    Returns void

engineInstanceReadyCallback

  • get engineInstanceReadyCallback(): (engineInstance: EngineView) => unknown
  • set engineInstanceReadyCallback(value: (engineInstance: EngineView) => unknown): void
  • callback function that will be called once everything is loaded and engine instance is ready

    property
    default

    null

    Returns (engineInstance: EngineView) => unknown

  • callback function that will be called once everything is loaded and engine instance is ready

    Parameters

    Returns void

followCharacter

  • get followCharacter(): boolean
  • set followCharacter(value: boolean): void
  • defines if the camera will follow the current controllable or not

    property
    default

    true

    Returns boolean

  • defines if the camera will follow the current controllable or not

    Parameters

    • value: boolean

    Returns void

highlightPath

  • get highlightPath(): boolean
  • set highlightPath(value: boolean): void
  • highlight the path when the current controllable moves on the map

    property
    default

    true

    Returns boolean

  • highlight the path when the current controllable moves on the map

    Parameters

    • value: boolean

    Returns void

highlightTargetTile

  • get highlightTargetTile(): boolean
  • set highlightTargetTile(value: boolean): void
  • Highlight the target tile when the current controllable moves on the map

    property
    default

    true

    Returns boolean

  • Highlight the target tile when the current controllable moves on the map

    Parameters

    • value: boolean

    Returns void

instantCameraRelocation

  • get instantCameraRelocation(): boolean
  • set instantCameraRelocation(value: boolean): void
  • specifies whether the camera moves instantly or with a tween animation to the target location

    property
    default

    false

    Returns boolean

  • specifies whether the camera moves instantly or with a tween animation to the target location

    Parameters

    • value: boolean

    Returns void

instantCameraZoom

  • get instantCameraZoom(): boolean
  • set instantCameraZoom(value: boolean): void
  • specifies whether to zoom instantly or with a tween animation

    property
    default

    false

    Returns boolean

  • specifies whether to zoom instantly or with a tween animation

    Parameters

    • value: boolean

    Returns void

instantObjectRelocation

  • get instantObjectRelocation(): boolean
  • set instantObjectRelocation(value: boolean): void
  • specifies whether the map-objects will be moved to target location instantly or with an animation

    property
    default

    false

    Returns boolean

  • specifies whether the map-objects will be moved to target location instantly or with an animation

    Parameters

    • value: boolean

    Returns void

mapDraggable

  • get mapDraggable(): boolean
  • set mapDraggable(value: boolean): void
  • enable dragging the map with touch-and-touchmove or mousedown-and-mousemove on the map

    property
    default

    true

    Returns boolean

  • enable dragging the map with touch-and-touchmove or mousedown-and-mousemove on the map

    Parameters

    • value: boolean

    Returns void

objectReachedDestinationCallback

  • get objectReachedDestinationCallback(): (objectView: ObjectView) => unknown
  • set objectReachedDestinationCallback(value: (objectView: ObjectView) => unknown): void
  • callback function that will be called when any moving object reaches its destination. Call param will be the moving object itself.

    property
    default

    null

    Returns (objectView: ObjectView) => unknown

  • callback function that will be called when any moving object reaches its destination. Call param will be the moving object itself.

    Parameters

    Returns void

objectSelectCallback

  • get objectSelectCallback(): (objectView: ObjectView) => unknown
  • set objectSelectCallback(value: (objectView: ObjectView) => unknown): void
  • callback function that will be called when a tile with an interactive map-object on it is selected. Call param will be the object selected.

    property
    default

    null

    Returns (objectView: ObjectView) => unknown

  • callback function that will be called when a tile with an interactive map-object on it is selected. Call param will be the object selected.

    Parameters

    Returns void

objectUpdateCallback

  • get objectUpdateCallback(): (objectView: ObjectView) => unknown
  • set objectUpdateCallback(value: (objectView: ObjectView) => unknown): void
  • callback function that will be called every time an objects direction or position changed

    property
    default

    null

    Returns (objectView: ObjectView) => unknown

  • callback function that will be called every time an objects direction or position changed

    Parameters

    Returns void

otherObjectsOnTheNextTileCallback

  • get otherObjectsOnTheNextTileCallback(): (objectView: ObjectView, otherObjectViews: ObjectView[]) => unknown
  • set otherObjectsOnTheNextTileCallback(value: (objectView: ObjectView, otherObjectViews: ObjectView[]) => unknown): void
  • callback function that will be called when any moving object is in move and there are other objects on the next tile. Call params will be the moving object and an array of objects on the next tile.

    property
    default

    null

    Returns (objectView: ObjectView, otherObjectViews: ObjectView[]) => unknown

  • callback function that will be called when any moving object is in move and there are other objects on the next tile. Call params will be the moving object and an array of objects on the next tile.

    Parameters

    Returns void

tileHighlightAnimated

  • get tileHighlightAnimated(): boolean
  • set tileHighlightAnimated(value: boolean): void

tileHighlightFillAlpha

  • get tileHighlightFillAlpha(): number
  • set tileHighlightFillAlpha(value: number): void
  • alpha value for the tile highlight fill (this will be overridden if a highlight-image is defined)

    property
    default

    1.0

    Returns number

  • alpha value for the tile highlight fill (this will be overridden if a highlight-image is defined)

    Parameters

    • value: number

    Returns void

tileHighlightFillColor

  • get tileHighlightFillColor(): number
  • set tileHighlightFillColor(value: number): void
  • color code for the tile highlight fill (this will be overridden if a highlight-image is defined)

    property
    default

    0x80d7ff

    Returns number

  • color code for the tile highlight fill (this will be overridden if a highlight-image is defined)

    Parameters

    • value: number

    Returns void

tileHighlightStrokeAlpha

  • get tileHighlightStrokeAlpha(): number
  • set tileHighlightStrokeAlpha(value: number): void
  • alpha value for the tile highlight stroke (this will be overridden if a highlight-image is defined)

    property
    default

    1.0

    Returns number

  • alpha value for the tile highlight stroke (this will be overridden if a highlight-image is defined)

    Parameters

    • value: number

    Returns void

tileHighlightStrokeColor

  • get tileHighlightStrokeColor(): number
  • set tileHighlightStrokeColor(value: number): void
  • color code for the tile highlight stroke (this will be overridden if a highlight-image is defined)

    property
    default

    0xFFFFFF

    Returns number

  • color code for the tile highlight stroke (this will be overridden if a highlight-image is defined)

    Parameters

    • value: number

    Returns void

tileSelectCallback

  • get tileSelectCallback(): (r: number, c: number) => unknown
  • set tileSelectCallback(value: (r: number, c: number) => unknown): void
  • callback function that will be called when a tile is selected. Params will be the row and column indexes of the tile selected.

    property
    default

    null

    Returns (r: number, c: number) => unknown

      • (r: number, c: number): unknown
      • Parameters

        • r: number
        • c: number

        Returns unknown

  • callback function that will be called when a tile is selected. Params will be the row and column indexes of the tile selected.

    Parameters

    • value: (r: number, c: number) => unknown
        • (r: number, c: number): unknown
        • Parameters

          • r: number
          • c: number

          Returns unknown

    Returns void

Methods

addCustomObjectToLocation

  • Enables adding external custom display objects to the specified location. This method should be used for the objects that are not already defined in json file and don't have a type-id. The resulting object will be independent of engine mechanics apart from depth controls.

    method
    function

    Parameters

    • displayObject: ObjectView

      object to be added to location

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns DisplayObject

    the newly added object

Private addObjRefToLocation

  • Adds a reference of the given map-object to the given location in the object array. This should be called when an object moved or transferred to the corresponding location. Uses objects size property to add its reference to all relevant cells.

    method
    function
    internal

    Parameters

    • obj: ObjectView

      object to be bind to location

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns void

Private addObjRefToSingleLocation

  • Adds a reference of the given map-object to the given location in the object array. Updates the cell as movable or not according to the object being movable onto or not.

    method
    function
    internal

    Parameters

    • obj: ObjectView

      object to be bind to location

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns void

addObjectToLocation

  • Adds an already-created object to the map.

    method
    function

    Parameters

    • obj: ObjectView

      a map-object to add to the map and the given location

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns ObjectView

    the newly added object

Private arrangeDepthsFromLocation

  • Arranges depths (z-index) of the map-objects starting from the given location.

    method
    function
    internal

    Parameters

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns void

Private arrangeObjLocation

  • Sets a map-object's location and logically moves it to the new location.

    method
    function
    internal

    Parameters

    Returns void

Private arrangeObjTransparencies

  • Sets occlusion transparencies according to given map-object's location. This method only works for user-controllable object.

    method
    function
    internal

    Parameters

    • obj: ObjectView

      current controllable map-object

    • prevPos: TColumnRowPair

      previous location of the map-object in terms of row and column coordinates

    • pos: TColumnRowPair

      new location of the map-object in terms of row and column coordinates

    Returns void

Private arrangePathHighlight

  • arrangePathHighlight(currentPath: GridNode[], newPath: GridNode[]): void
  • Clears the highlight for the old path and highlights the new path on map.

    method
    function
    internal

    Parameters

    • currentPath: GridNode[]

      the old path to clear the highlight from

    • newPath: GridNode[]

      the new path to highlight

    Returns void

Private assetsAndDataLoaded

  • assetsAndDataLoaded(loader: Loader): void
  • Handles loading of map data for the given engine instance.

    method
    function
    internal

    Parameters

    • loader: Loader

      PIXI's loader instance

    Returns void

centralizeToCurrentExternalCenter

  • centralizeToCurrentExternalCenter(instantRelocate: boolean): void
  • External center is the central point of the frame defined by the user to be used as the visual size of the engine. This method centralizes the EngineView instance with respect to this external center-point.

    method
    function

    Parameters

    • instantRelocate: boolean

      specifies if the camera move will be animated or instant

    Returns void

centralizeToCurrentFocusLocation

  • centralizeToCurrentFocusLocation(instantRelocate: boolean): void
  • Centralizes the EngineView instance to the current location of the attention/focus.

    method

    centralizeToCurrentFocusLocation

    Parameters

    • instantRelocate: boolean

    Returns void

centralizeToLocation

  • centralizeToLocation(c: number, r: number, instantRelocate: boolean): void
  • Centralizes the EngineView instance to the map location specified by row and column index.

    method

    centralizeToLocation

    Parameters

    • c: number

      the column index of the map location

    • r: number

      the row index of the map location

    • instantRelocate: boolean

    Returns void

centralizeToObject

  • Centralizes the EngineView instance to the object specified.

    method

    centralizeToObject

    Parameters

    • obj: ObjectView

      the object that map will be centralized with respect to

    Returns void

centralizeToPoint

  • centralizeToPoint(px: number, py: number, instantRelocate: boolean): void
  • Centralizes the EngineView instance to the points specified.

    method
    function

    Parameters

    • px: number

      the x coordinate of the center point with respect to EngineView frame

    • py: number

      the y coordinate of the center point with respect to EngineView frame

    • instantRelocate: boolean

      specifies if the relocation will be animated or instant

    Returns void

changeObjAlphasInLocation

  • Sets alphas of the map-objects referenced to the given location.

    method

    changeObjAlphasInLocation

    Parameters

    • value: number

      alpha value, should be between 0 and 1

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns void

checkAndMoveObjectToLocation

  • Checks for a path and moves the map-object on map if there is an available path

    method
    function

    Parameters

    • obj: ObjectView

      map-object that is being moved

    • pos: TColumnRowPair

      object including row and column coordinates for the target location

    • speed: number = null

      speed of the map-object to be used during movement, if not defined it uses previous speed or the MoveEngine's default speed, default null

    Returns boolean

    if there is an available path to move to the target tile

checkAndMoveObjectToTile

  • Checks for a path and moves the map-object on map if there is an available path

    method
    function

    Parameters

    • obj: ObjectView

      map-object that is being moved

    • tile: TileView

      target map-tile or any custom object that has 'mapPos' and 'isMovableTo' defined

    • speed: number = null

      speed of the map-object to be used during movement, if not defined it uses previous speed or the MoveEngine's default speed, default null

    Returns boolean

    if there is an available path to move to the target tile

checkForFollowCharacter

  • checkForFollowCharacter(obj: IMovable): void
  • Checks and follows a character

    method
    function
    internal

    Parameters

    • obj: IMovable

      map-object to check if it is being followed

    Returns void

checkForTileChange

  • checkForTileChange(obj: IMovable): void
  • Checks if a map-object changes the tile it is on.

    method
    function
    internal

    Parameters

    • obj: IMovable

      map-object to be checked

    Returns void

Private checkForTileClick

  • checkForTileClick(interactionData: InteractionData): void
  • Checks if an interaction occurs using the interaction data coming from PIXI. If there is any interaction starts necessary movements or performs necessary callbacks.

    method
    function
    internal

    Parameters

    • interactionData: InteractionData

      interaction data coming from PIXI

    Returns void

createAndAddObjectToLocation

  • Creates and adds a predefined (in json file) map-object to the map using the specified object type-id.

    method
    function

    Parameters

    • type: string

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

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns ObjectView

    the newly created map-object

Private createMap

  • createMap(): void
  • Creates the map and setups necessary parameters for future map calculations.

    method
    function
    internal

    Returns void

destroy

  • destroy(): void
  • Clears all references and stops all animations inside the engine. Call this method when you want to get rid of an engine instance.

    method
    function

    Returns void

disableInteraction

  • disableInteraction(): void

enableInteraction

  • enableInteraction(): void

focusMapToLocation

  • focusMapToLocation(c: number, r: number, zoomAmount: number): void
  • Centralizes and zooms the EngineView instance to the map location specified by row and column index.

    method

    focusMapToLocation

    Parameters

    • c: number

      the column index of the map location

    • r: number

      the row index of the map location

    • zoomAmount: number

      targeted zoom level for focusing

    Returns void

focusMapToObject

  • Centralizes and zooms the EngineView instance to the object specified.

    method

    focusMapToObject

    Parameters

    • obj: ObjectView

      the object that map will be focused with respect to

    Returns void

getCurrentControllable

  • Returns the current controllable map-object.

    method

    getCurrentControllable

    Returns ObjectView

    current controllable map-object

getObjectsAtLocation

  • Returns all the ObjectView instances referenced to the given location.

    method
    function

    Parameters

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns ObjectView[]

    an array of map-objects referenced to the given location

getObjectsAtRowAndColumn

  • getObjectsAtRowAndColumn(r: number, c: number): ObjectView[]
  • Returns all the ObjectView instances referenced to the given location with the specified row and column indices.

    method
    function

    Parameters

    • r: number

      the row index of the map location

    • c: number

      the column index of the map location

    Returns ObjectView[]

    an array of map-objects referenced to the given location

getPath

  • Searches and returns a path between two locations if there is one.

    method
    function

    Parameters

    • from: TColumnRowPair

      object including row and column coordinates of the source location

    • to: TColumnRowPair

      object including row and column coordinates of the target location

    Returns GridNode[]

    an array of path items defining the path

getTileAtRowAndColumn

  • getTileAtRowAndColumn(r: number, c: number): TileView
  • Returns the TileView instance that sits in the location given by row and column indices.

    method
    function

    Parameters

    • r: number

      row index of the tile

    • c: number

      column index of the tile

    Returns TileView

    the tile in the location given

getTileFromLocalPos

  • Finds the nearest tile to the point given in the map's local scope.

    method
    function

    Parameters

    Returns TileView

    The nearest map-tile if there is one. Otherwise null

getTilePosXFor

  • getTilePosXFor(r: number, c: number): number
  • Calculates 2D X position of a tile, given its column and row indices.

    method
    function

    Parameters

    • r: number

      row index of the tile

    • c: number

      column index of the tile

    Returns number

    2D X position of a tile

getTilePosYFor

  • getTilePosYFor(r: number, c: number): number
  • Calculates 2D Y position of a tile, given its column and row indices.

    method
    function

    Parameters

    • r: number

      row index of the tile

    • c: number

      column index of the tile

    Returns number

    2D Y position of a tile

Private isInteractionInMask

  • Checks if the given point is inside the masked area if there is a mask defined.

    method
    function
    internal

    Parameters

    Returns boolean

    if the point is inside the masked area

Private loadAssetsAndData

  • loadAssetsAndData(): void
  • Handles loading of necessary assets and map data for the given engine instance.

    method
    function
    internal

    Returns void

moveCurrentControllableToLocation

  • moveCurrentControllableToLocation(pos: TColumnRowPair, speed?: number): boolean
  • Moves the current controllable map-object to a location if available.

    method
    function

    Parameters

    • pos: TColumnRowPair

      object including row and column coordinates for the target location

    • speed: number = null

      speed of the map-object to be used during movement, if not defined it uses previous speed or the MoveEngine's default speed, default null

    Returns boolean

    if there is an available path to move to the target tile

moveCurrentControllableToObj

  • moveCurrentControllableToObj(obj: ObjectView, speed?: number): boolean
  • Moves the current controllable map-object to one of the adjacent available tiles of the map-object specified.

    method
    function

    Parameters

    • obj: ObjectView

      target map-object

    • speed: number = null

      speed of the map-object to be used during movement, if not defined it uses previous speed or the MoveEngine's default speed, default null

    Returns boolean

    if there is an available path to move to the target map-object

Private moveObjThrough

  • moveObjThrough(obj: IMovable, path: GridNode[], speed?: number): void
  • Moves the specified map-object through a path.

    method
    function
    internal

    Parameters

    • obj: IMovable

      map-object to be moved on path

    • path: GridNode[]

      path to move object on

    • speed: number = null

      speed of the map-object to be used during movement, if not defined it uses previous speed or the MoveEngine's default speed, default null

    Returns void

Private onAllAssetsLoaded

  • onAllAssetsLoaded(): void
  • This method is being called whenever all the assets are loaded and engine is ready to initialize.

    method
    function
    internal

    Returns void

Private onMouseDown

  • onMouseDown(event: InteractionEvent): void
  • Handler function for mouse-down event.

    method
    function
    internal

    Parameters

    • event: InteractionEvent

      interaction event object

    Returns void

Private onMouseMove

  • onMouseMove(event: InteractionEvent): void
  • Handler function for mouse-move event.

    method
    function
    internal

    Parameters

    • event: InteractionEvent

      interaction event object

    Returns void

Private onMouseUp

  • onMouseUp(event: InteractionEvent): void
  • Handler function for mouse-up event.

    method
    function
    internal

    Parameters

    • event: InteractionEvent

      interaction event object

    Returns void

Private onObjMoveStepBegin

  • Sets up the engine at the beginning of each tile change move for the specified object

    method
    function
    internal

    Parameters

    • obj: IMovable

      map-object that is being moved

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns boolean

    if the target tile was available and map-object has moved

onObjMoveStepEnd

  • onObjMoveStepEnd(obj: IMovable): void
  • Sets up the engine at the end of each tile change move for the specified object

    method
    function
    internal

    Parameters

    • obj: IMovable

      map-object that is being moved

    Returns void

Private removeObjRefFromLocation

  • Removes references of the given map-object from the given location in the object array. This should be called when an object moved or transferred from the corresponding location. Uses objects size property to remove its references from all relevant cells.

    method
    function
    internal

    Parameters

    • obj: ObjectView

      object to be bind to location

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns void

Private removeObjRefFromSingleLocation

  • Removes a reference of the given map-object from the given location in the object array. Updates the cell as movable or not according to the other object references in the same cell.

    method
    function
    internal

    Parameters

    • obj: ObjectView

      object to be bind to location

    • pos: TColumnRowPair

      position object including row and column coordinates

    Returns void

removeObjectFromLocation

  • Removes the object and its references from the map.

    method
    function

    Parameters

    • obj: ObjectView

      Either an external display object or a map-object (ObjectView)

    • pos: TColumnRowPair

      position object including row and column coordinates. If not defined, the engine will use obj.mapPos to remove the map-object

    Returns void

repositionContent

  • Repositions the content according to user settings. Call this method whenever you want to change the size or position of the engine.

    method
    function

    Parameters

    • posFrame: TPositionFrame = null

      frame to position the engine, default is the previously set posFrame and if not set, it is { x : 0, y : 0, w : 800, h : 600 }

    Returns void

setCurrentControllable

  • Sets a map-object as the current controllable. This object will be moving in further relevant user interactions.

    method

    setCurrentControllable

    Parameters

    • obj: ObjectView

      object to be set as current controllable

    Returns void

Private setScale

  • setScale(s: number, instantZoom: boolean): void
  • Sets map's scale.

    method
    function
    internal

    Parameters

    • s: number

      Scale amount for both x and y coordinates

    • instantZoom: boolean

      Specifies if the scaling will be animated or instant

    Returns void

setZoomParameters

  • setZoomParameters(minScale?: number, maxScale?: number, numberOfZoomLevels?: number, initialZoomLevel?: number, instantCameraZoom?: boolean): void
  • Sets all the parameters related to zooming in and out.

    method
    function

    Parameters

    • minScale: number = 0.5

      minimum scale that the PIXI.Container for the map can get, default 0.5

    • maxScale: number = 1.5

      maximum scale that the PIXI.Container for the map can get, default 1.5

    • numberOfZoomLevels: number = 5

      used to calculate zoom increment, defined by user, default 5

    • initialZoomLevel: number = 0

      initial zoom level of the map, default 0

    • instantCameraZoom: boolean = false

      specifies whether to zoom instantly or with a tween animation, default false

    Returns void

showHideGroundLayer

  • showHideGroundLayer(show?: boolean): void
  • Shows or hides the display object that includes the ground/terrain layer

    method
    function

    Parameters

    • show: boolean = false

      show the ground layer, default false

    Returns void

showHideObjectLayer

  • showHideObjectLayer(show?: boolean): void
  • Shows or hides the display object that includes the objects-layer

    method
    function

    Parameters

    • show: boolean = false

      show the object layer, default false

    Returns void

Private stopObject

  • stopObject(obj: IMovable): void
  • Stops a moving object.

    method
    function
    internal

    Parameters

    • obj: IMovable

      map-object to be moved on path

    Returns void

zoomIn

  • zoomIn(instantZoom: boolean): void
  • Zooms the camera one level in.

    method

    zoomIn

    Parameters

    • instantZoom: boolean

    Returns void

zoomOut

  • zoomOut(instantZoom: boolean): void
  • Zooms the camera one level out.

    method
    function

    Parameters

    • instantZoom: boolean

      Specifies whether to zoom instantly or with a tween animation

    Returns void

zoomTo

  • zoomTo(zoomAmount: number, instantZoom: boolean): void
  • Zooms camera by to the amount given.

    method
    function

    Parameters

    • zoomAmount: number

      specifies zoom amount (between -1 and 1). Use -1, -0.5, 0, 0,5, 1 for better results.

    • instantZoom: boolean

      specifies whether to zoom instantly or with a tween animation

    Returns void