RegionManager.centerEntityOnTile()

   
Type function
Library wattageTileEngine.RegionManager.*
Return value VOID
Keywords  
See also  

Overview

This function will center an entity on the specified tile.

NOTE: This function should always be used when utilizing the RegionManager. The function on the EntityLayer with the same name should not be used as it does not handle the world and local coordinate systems like this function does.

Syntax

RegionManager.centerEntityOnTile( entityLayerIndex, entityId, worldRow, worldColumn )
entityLayerIndex (required)

Number. The index of the entity layer that contains the entity ID.

entityId (required)

Number. The ID of the entity to center on the tile.

worldRow (required)

Number. The row to center the entity on. This coordinate is in world coordinates not local layer coordinates.

worldColumn (required)

Number. The column to center the entity on. This coordinate is in world coordinates not local layer coordinates.

Examples

regionManager.centerEntityOnTile(2, 42, 1, 1)