EntityLayer.addEntity()

   
Type function
Library wattageTileEngine.EntityLayer.*
Return value Number, SpriteInfo
Keywords  
See also  

Overview

This function adds an entity represented visually by the resource associated with the specified key. The key specified will be resolved by the entity layer’s sprite resolver. The function will return an ID which can be used to reference the resource and the SpriteInfo for the entity.

Syntax

EntityLayer.addEntity( resourceKey )
resourceKey (required)

String. Key to be resolved by the EntityLayer’s SpriteResolver.

Examples

local id, spriteInfo = entityLayerInstance.addEntity("resourceKey")