RegionManager.setNonResourceEntityLocation()

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

Overview

This function will center the non-resource 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 a non-resource 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.setNonResourceEntityLocation( entityLayerIndex, nonResourcentityId, worldX, worldY )
entityLayerIndex (required)

Number. The index of the entity layer that contains the non-resource entity ID.

nonResourcentityId (required)

Number. The ID of the non-resource entity to set the position of.

worldX (required)

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

worldY (required)

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

Examples

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