LdtkEntityDefinition

ceramic.LdtkEntityDefinition (Class)

Defines an entity type that can be placed in levels.

Entities are game objects like players, enemies, items, triggers, etc. This definition describes the entity's appearance, fields, and behavior rules.

Instance Members

The LdtkDefinitions object this entity def belongs to


ldtk
color: Color

Base entity color


ldtk
width: Int

Pixel width


ldtk
height: Int

Pixel height


ldtk
identifier: String

User defined unique identifier


ldtk
nineSliceBorders: Array<Int>

An array of 4 dimensions for the up/right/down/left borders (in this order) when using 9-slice mode for tileRenderMode. If the tileRenderMode is not NineSlice, then this array is empty.

See: https://en.wikipedia.org/wiki/9-slice_scaling

ldtk
pivotX: Float

Pivot X coordinate (from 0 to 1.0)


ldtk
pivotY: Float

Pivot Y coordinate (from 0 to 1.0)


ldtk
renderMode: LdtkRenderMode

Render mode


ldtk
tileRect: LdtkTilesetRectangle

An object representing a rectangle from an existing Tileset (can be null)


ldtk
tileRenderMode: LdtkTileRenderMode

An enum describing how the the Entity tile is rendered inside the Entity bounds.


The corresponding Tileset definition, if any, for optional tile display


ldtk
uid: Int

Unique Int identifier


ldtk
tags: Array<String>

An array of strings that classifies this entity


ldtk
fieldDefs: Array<LdtkFieldDefinition>

An array of field definitions that belong to this entity definition


ldtk
isRenderable(renderMode: LdtkRenderMode): Bool

Returns true if entities instances having this entity definition can be rendered with the given renderMode. Will also check that the definition is not using internal icons as well, as they should not be rendered anyway.

Name Type Description
renderMode LdtkRenderMode The render mode we want to test
Returns Description
Bool Bool

ldtk
toString(): String
Returns
String

ldtk
fieldDef(identifier: String): LdtkFieldDefinition
Name Type
identifier String
Returns
LdtkFieldDefinition

Name Type Default
defs LdtkDefinitions (optional)
json haxe.DynamicAccess<Dynamic> (optional)