Constructor method for the main PIXI.Container class to hold all views within the engine and all map related logic.
{TEngineConfiguration} configuration object for the isometric engine instance
Private Internal_Solid colored background
Private Internal_Internal property holding the engine configuration.
Private Internal_Current controllable map-object that will be the default object to move in user interactions
Private Internal_Private Internal_Current scale of the map's display object
Private Internal_Current zoom amount of the map
Private Internal_Private Internal_Private Internal_Private Internal_Private Internal_Private Internal_Active external center point for the engine.
Private Internal_Display object for the ground/terrain visuals
Private Internal_Display object for the map visuals
Private Internal_Mask graphics for the mask
Private Internal_Number of columns in the isometric map
Private Internal_Number of rows in the isometric map
Private Internal_Vertices of the map
Private Internal_Total height of all ground tiles
Private Internal_Total width of all ground tiles
Private Internal_Private Internal_Array to hold map-objects
Private Internal_Display object for the map-object visuals
Private Internal_PathFinding instance to handle all path finding logic
Private Internal_Active position frame for the engine.
Private Internal_Array to hold map-tiles
Variable holding the parsed and processed map data
MoveEngine instance to handle all animations and tweens
Private InternalonPrivate InternalonPrivate InternalonReadonlytileHalf-height of a single isometric tile
ReadonlytileHalf-width of a single isometric tile
Private Static ReadonlyDEFAULT_The default angle (in degrees) between the top-left edge and the horizontal diagonal of a isometric quad
Private Static ReadonlyDEFAULT_The default height of a single isometric tile
callback function that will be called once everything is loaded and engine instance is ready
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 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.
FunctionEnables 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.
{PIXI.DisplayObject} object to be added to location
{TColumnRowPair} position object including row and column coordinates
the newly added object
FunctionAdds an already-created object to the map.
{ObjectView} a map-object to add to the map and the given location
{TColumnRowPair} position object including row and column coordinates
the newly added object
PrivateaddPrivate Function InternalAdds 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.
{ObjectView} object to be bind to location
{TColumnRowPair} position object including row and column coordinates
PrivateaddPrivate Function InternalAdds 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.
{ObjectView} object to be bind to location
{TColumnRowPair} position object including row and column coordinates
PrivatearrangePrivate Function InternalArranges depths (z-index) of the map-objects starting from the given location.
{TColumnRowPair} position object including row and column coordinates
PrivatearrangePrivate Function InternalSets a map-object's location and logically moves it to the new location.
{ObjectView} map-object to be moved
{TColumnRowPair} position object including row and column coordinates
PrivatearrangePrivate Function InternalSets occlusion transparencies according to given map-object's location. This method only works for user-controllable object.
{ObjectView} current controllable map-object
{TColumnRowPair} previous location of the map-object in terms of row and column coordinates
{TColumnRowPair} new location of the map-object in terms of row and column coordinates
PrivatearrangePrivateassetsPrivate Function InternalHandles loading of map data for the given engine instance.
{TMapData} loaded map data
FunctionExternal 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.
{boolean} specifies if the camera move will be animated or instant
Centralizes the EngineView instance to the map location specified by row and column index.
{number} the column index of the map location
{number} the row index of the map location
OptionalinstantRelocate: boolean{boolean} specifies if the camera move will be animated or instant
Centralizes the EngineView instance to the object specified.
{ObjectView} the object that map will be centralized with respect to
FunctionCentralizes the EngineView instance to the points specified.
{number} the x coordinate of the center point with respect to EngineView frame
{number} the y coordinate of the center point with respect to EngineView frame
{boolean} specifies if the relocation will be animated or instant
Sets alphas of the map-objects referenced to the given location.
{number} alpha value, should be between 0 and 1
{TColumnRowPair} position object including row and column coordinates
FunctionChecks for a path and moves the map-object on map if there is an available path
{ObjectView} map-object that is being moved
{TColumnRowPair} object including row and column coordinates for the target location
{number} 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
FunctionChecks for a path and moves the map-object on map if there is an available path
{ObjectView} map-object that is being moved
{TileView} target map-tile or any custom object that has 'mapPos' and 'isMovableTo' defined
{number} 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
PrivatecheckPrivate Function InternalChecks if an interaction occurs using the global pointer position coming from PIXI. If there is any interaction starts necessary movements or performs necessary callbacks.
{TPositionPair} pointer position in global coordinates
FunctionCreates and adds a predefined (in json file) map-object to the map using the specified object type-id.
{number} type-id of the object as defined in the json file
{TColumnRowPair} position object including row and column coordinates
the newly created map-object
PrivatecreateCentralizes and zooms the EngineView instance to the map location specified by row and column index.
{number} the column index of the map location
{number} the row index of the map location
{number} targeted zoom level for focusing
Centralizes and zooms the EngineView instance to the object specified.
{ObjectView} the object that map will be focused with respect to
FunctionReturns all the ObjectView instances referenced to the given location.
{TColumnRowPair} position object including row and column coordinates
an array of map-objects referenced to the given location
FunctionReturns all the ObjectView instances referenced to the given location with the specified row and column indices.
{number} the row index of the map location
{number} the column index of the map location
an array of map-objects referenced to the given location
FunctionSearches and returns a path between two locations if there is one.
{TColumnRowPair} object including row and column coordinates of the source location
{TColumnRowPair} object including row and column coordinates of the target location
an array of path items defining the path
FunctionReturns the TileView instance that sits in the location given by row and column indices.
{number} row index of the tile
{number} column index of the tile
the tile in the location given
FunctionFinds the nearest tile to the point given in the map's local scope.
{TPositionPair} Point to check
The nearest map-tile if there is one. Otherwise null
PrivateisPrivate Function InternalChecks if the given point is inside the masked area if there is a mask defined.
{TPositionPair} point to check
if the point is inside the masked area
PrivateloadFunctionMoves the current controllable map-object to a location if available.
{TColumnRowPair} object including row and column coordinates for the target location
{number} 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
FunctionMoves the current controllable map-object to one of the adjacent available tiles of the map-object specified.
{ObjectView} target map-object
{number} 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
PrivatemovePrivate Function InternalMoves the specified map-object through a path.
{IMovable} map-object to be moved on path
{Array(GridNode)} path to move object on
{number} 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
PrivateonPrivateonPrivateonPrivateonPrivateonPrivate Function InternalSets up the engine at the beginning of each tile change move for the specified object
{IMovable} map-object that is being moved
{TColumnRowPair} position object including row and column coordinates
if the target tile was available and map-object has moved
FunctionRemoves the object and its references from the map.
{ObjectView} Either an external display object or a map-object (ObjectView)
{TColumnRowPair} position object including row and column coordinates. If not defined, the engine will use obj.mapPos to remove the map-object
PrivateremovePrivate Function InternalRemoves 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.
{ObjectView} object to be bind to location
{TColumnRowPair} position object including row and column coordinates
PrivateremovePrivate Function InternalRemoves 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.
{ObjectView} object to be bind to location
{TColumnRowPair} position object including row and column coordinates
FunctionRepositions the content according to user settings. Call this method whenever you want to change the size or position of the engine.
{TPositionFrame} 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.
{ObjectView} object to be set as current controllable
PrivatesetFunctionSets all the parameters related to zooming in and out.
{number} minimum scale that the PIXI.Container for the map can get, default 0.5
{number} maximum scale that the PIXI.Container for the map can get, default 1.5
{number} used to calculate zoom increment, defined by user, default 5
{number} initial zoom level of the map, default 0
{boolean} specifies whether to zoom instantly or with a tween animation, default false
Privatestop
Main PIXI.Container class to hold all views within the engine and all map related logic.
EngineView