LdtkVisual

EntityVisualQuadceramic.LdtkVisual (Class)

A default visual implementation to render LDtk entities.

This class automatically creates the appropriate visual representation for an LDtk entity based on its tile settings and render mode.

Supported tile render modes:

  • Cover: Scales tile to cover the entire entity bounds
  • FitInside: Scales tile to fit within entity bounds while maintaining aspect ratio
  • Repeat: Tiles the texture to fill the entity bounds
  • Stretch: Stretches the tile to match entity dimensions
  • FullSizeCropped: Shows tile at original size, cropped to entity bounds
  • FullSizeUncropped: Shows tile at original size, even if larger than entity
  • NineSlice: Uses nine-slice scaling for UI elements

Instance Members

ldtk
ldtkEntity: LdtkEntityInstance

The LDtk entity instance this visual represents. Contains all the entity data including position, size, and custom fields.


ldtk
new(ldtkEntity: LdtkEntityInstance): Void

Creates a new visual representation for an LDtk entity. Automatically sets up the appropriate rendering based on the entity's tile settings.

Name Type Description
ldtkEntity LdtkEntityInstance The LDtk entity instance to visualize

Private Members

ldtk
setup(): Void

Sets up the visual representation based on the entity's properties. Handles positioning, sizing, anchoring, and creates the appropriate visual elements based on the tile render mode.

Metadata

Name Parameters
:build ceramic.macros.EntityMacro.buildForCompletion()
:autoBuild ceramic.macros.EntityMacro.buildForCompletion()
:build tracker.macros.EventsMacro.build()
:autoBuild tracker.macros.EventsMacro.build()