Constructor method for the main PIXI.Container class to hold all views within the engine and all map related logic.
configuration object for the isometric engine instance
Solid colored background
Internal property holding the engine configuration.
Current controllable map-object that will be the default object to move in user interactions
Current scale of the map's display object
Current zoom amount of the map
Active external center point for the engine.
Display object for the ground/terrain visuals
Display object for the map visuals
Mask graphics for the mask
Number of columns in the isometric map
Number of rows in the isometric map
Vertices of the map
Total height of all ground tiles
Total width of all ground tiles
Array to hold map-objects
Display object for the map-object visuals
PathFinding instance to handle all path finding logic
Active position frame for the engine.
Array to hold map-tiles
Variable holding the parsed and processed map data
MoveEngine instance to handle all animations and tweens
Half-height of a single isometric tile
Half-width of a single isometric tile
The default angle (in degrees) between the top-left edge and the horizontal diagonal of a isometric quad
The default height of a single isometric tile
make objects transparent when the controllable is behind them
make objects transparent when the controllable is behind them
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)
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)
When a tile selected don't move the controllable immediately but still call 'tileSelectCallback'
When a tile selected don't move the controllable immediately but still call 'tileSelectCallback'
callback function that will be called once everything is loaded and engine instance is ready
callback function that will be called once everything is loaded and engine instance is ready
defines if the camera will follow the current controllable or not
defines if the camera will follow the current controllable or not
highlight the path when the current controllable moves on the map
highlight the path when the current controllable moves on the map
Highlight the target tile when the current controllable moves on the map
Highlight the target tile when the current controllable moves on the map
specifies whether the camera moves instantly or with a tween animation to the target location
specifies whether the camera moves instantly or with a tween animation to the target location
specifies whether to zoom instantly or with a tween animation
specifies whether to zoom instantly or with a tween animation
specifies whether the map-objects will be moved to target location instantly or with an animation
specifies whether the map-objects will be moved to target location instantly or with an animation
enable dragging the map with touch-and-touchmove or mousedown-and-mousemove on the map
enable dragging the map with touch-and-touchmove or mousedown-and-mousemove on the map
callback function that will be called when any moving object reaches its destination. Call param will be the moving object itself.
callback function that will be called when any moving object reaches its destination. Call param will be the moving object itself.
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.
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.
callback function that will be called every time an objects direction or position changed
callback function that will be called every time an objects direction or position changed
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.
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.
animate the tile highlights
animate the tile highlights
alpha value for the tile highlight fill (this will be overridden if a highlight-image is defined)
alpha value for the tile highlight fill (this will be overridden if a highlight-image is defined)
color code for the tile highlight fill (this will be overridden if a highlight-image is defined)
color code for the tile highlight fill (this will be overridden if a highlight-image is defined)
alpha value for the tile highlight stroke (this will be overridden if a highlight-image is defined)
alpha value for the tile highlight stroke (this will be overridden if a highlight-image is defined)
color code for the tile highlight stroke (this will be overridden if a highlight-image is defined)
color code for the tile highlight stroke (this will be overridden if a highlight-image is defined)
callback function that will be called when a tile is selected. Params will be the row and column indexes of the tile selected.
callback function that will be called when a tile is selected. Params will be the row and column indexes of the tile selected.
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.
object to be added to location
position object including row and column coordinates
the newly added object
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.
object to be bind to location
position object including row and column coordinates
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.
object to be bind to location
position object including row and column coordinates
Adds an already-created object to the map.
a map-object to add to the map and the given location
position object including row and column coordinates
the newly added object
Arranges depths (z-index) of the map-objects starting from the given location.
position object including row and column coordinates
Sets a map-object's location and logically moves it to the new location.
map-object to be moved
position object including row and column coordinates
Sets occlusion transparencies according to given map-object's location. This method only works for user-controllable object.
current controllable map-object
previous location of the map-object in terms of row and column coordinates
new location of the map-object in terms of row and column coordinates
Clears the highlight for the old path and highlights the new path on map.
the old path to clear the highlight from
the new path to highlight
Handles loading of map data for the given engine instance.
PIXI's loader instance
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.
specifies if the camera move will be animated or instant
Centralizes the EngineView instance to the current location of the attention/focus.
Centralizes the EngineView instance to the map location specified by row and column index.
the column index of the map location
the row index of the map location
Centralizes the EngineView instance to the object specified.
the object that map will be centralized with respect to
Centralizes the EngineView instance to the points specified.
the x coordinate of the center point with respect to EngineView frame
the y coordinate of the center point with respect to EngineView frame
specifies if the relocation will be animated or instant
Sets alphas of the map-objects referenced to the given location.
alpha value, should be between 0 and 1
position object including row and column coordinates
Checks for a path and moves the map-object on map if there is an available path
map-object that is being moved
object including row and column coordinates for the target location
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
if there is an available path to move to the target tile
Checks for a path and moves the map-object on map if there is an available path
map-object that is being moved
target map-tile or any custom object that has 'mapPos' and 'isMovableTo' defined
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
if there is an available path to move to the target tile
Checks and follows a character
map-object to check if it is being followed
Checks if a map-object changes the tile it is on.
map-object to be checked
Checks if an interaction occurs using the interaction data coming from PIXI. If there is any interaction starts necessary movements or performs necessary callbacks.
interaction data coming from PIXI
Creates and adds a predefined (in json file) map-object to the map using the specified object type-id.
type-id of the object as defined in the json file
position object including row and column coordinates
the newly created map-object
Creates the map and setups necessary parameters for future map calculations.
Clears all references and stops all animations inside the engine. Call this method when you want to get rid of an engine instance.
Disables mouse/touch interactions.
Enables mouse/touch interactions.
Centralizes and zooms the EngineView instance to the map location specified by row and column index.
the column index of the map location
the row index of the map location
targeted zoom level for focusing
Centralizes and zooms the EngineView instance to the object specified.
the object that map will be focused with respect to
Returns the current controllable map-object.
current controllable map-object
Returns all the ObjectView instances referenced to the given location.
position object including row and column coordinates
an array of map-objects referenced to the given location
Returns all the ObjectView instances referenced to the given location with the specified row and column indices.
the row index of the map location
the column index of the map location
an array of map-objects referenced to the given location
Searches and returns a path between two locations if there is one.
object including row and column coordinates of the source location
object including row and column coordinates of the target location
an array of path items defining the path
Returns the TileView instance that sits in the location given by row and column indices.
row index of the tile
column index of the tile
the tile in the location given
Finds the nearest tile to the point given in the map's local scope.
Point to check
The nearest map-tile if there is one. Otherwise null
Calculates 2D X position of a tile, given its column and row indices.
row index of the tile
column index of the tile
2D X position of a tile
Calculates 2D Y position of a tile, given its column and row indices.
row index of the tile
column index of the tile
2D Y position of a tile
Checks if the given point is inside the masked area if there is a mask defined.
point to check
if the point is inside the masked area
Handles loading of necessary assets and map data for the given engine instance.
Moves the current controllable map-object to a location if available.
object including row and column coordinates for the target location
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
if there is an available path to move to the target tile
Moves the current controllable map-object to one of the adjacent available tiles of the map-object specified.
target map-object
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
if there is an available path to move to the target map-object
Moves the specified map-object through a path.
map-object to be moved on path
path to move object on
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
This method is being called whenever all the assets are loaded and engine is ready to initialize.
Handler function for mouse-down event.
interaction event object
Handler function for mouse-move event.
interaction event object
Handler function for mouse-up event.
interaction event object
Sets up the engine at the beginning of each tile change move for the specified object
map-object that is being moved
position object including row and column coordinates
if the target tile was available and map-object has moved
Sets up the engine at the end of each tile change move for the specified object
map-object that is being moved
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.
object to be bind to location
position object including row and column coordinates
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.
object to be bind to location
position object including row and column coordinates
Removes the object and its references from the map.
Either an external display object or a map-object (ObjectView)
position object including row and column coordinates. If not defined, the engine will use obj.mapPos
to remove the map-object
Repositions the content according to user settings. Call this method whenever you want to change the size or position of the engine.
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 }
Sets a map-object as the current controllable. This object will be moving in further relevant user interactions.
object to be set as current controllable
Sets map's scale.
Scale amount for both x and y coordinates
Specifies if the scaling will be animated or instant
Sets all the parameters related to zooming in and out.
minimum scale that the PIXI.Container for the map can get, default 0.5
maximum scale that the PIXI.Container for the map can get, default 1.5
used to calculate zoom increment, defined by user, default 5
initial zoom level of the map, default 0
specifies whether to zoom instantly or with a tween animation, default false
Shows or hides the display object that includes the ground/terrain layer
show the ground layer, default false
Shows or hides the display object that includes the objects-layer
show the object layer, default false
Stops a moving object.
map-object to be moved on path
Zooms the camera one level in.
Zooms the camera one level out.
Specifies whether to zoom instantly or with a tween animation
Zooms camera by to the amount given.
specifies zoom amount (between -1 and 1). Use -1, -0.5, 0, 0,5, 1 for better results.
specifies whether to zoom instantly or with a tween animation
Main PIXI.Container class to hold all views within the engine and all map related logic.