RegionManager.setEntityLocation()

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

Overview

This function will center the entity with the specified ID in the specified entity layer on the specified point in world coordinates.

NOTE: This function should always be used to set an entity’s position when utilizing the RegionManager. Setting the x and y values directly on the sprite will not factor in the world to local coordinate conversions.

Syntax

RegionManager.setEntityLocation( entityLayerIndex, entityId, worldX, worldY )
entityLayerIndex (required)

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

entityId (required)

Number. The ID of the entity to set the position of.

worldX (required)

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

worldY (required)

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

Examples

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