TileAttribute
StructSource: Renderer.h
Description
Single attribute key-value pair for tile metadata.
TileAttribute represents a single metadata entry attached to a tile, such as collision properties, interaction types, or game-specific data. Both key and value are stored as PROGMEM strings to minimize RAM usage on ESP32.
Attributes are exported from the PixelRoot32 Tilemap Editor with final resolved values (tileset defaults merged with instance overrides). The editor's two-level attribute system (default + instance) is collapsed at export time, so runtime code only sees the final merged result.
Common Use Cases:
- Collision detection: {"solid", "true"},
- Interaction: {"type", "door"},
- Game logic: {"damage", "10"},
- Tile behavior: {"animated", "true"},
Memory Layout:
- Both pointers reference flash memory (PROGMEM/PIXELROOT32_SCENE_FLASH_ATTR)
- No RAM overhead for string storage
- Suitable for ESP32 with limited RAM
All strings are null-terminated C strings stored in flash memory Use strcmp_P() or similar PROGMEM-aware functions to compare keys Values are always strings; convert to int/bool as needed in game code
TileAttributeEntry for tile position association LayerAttributes for layer-level attribute organization
TIP
All strings are null-terminated C strings stored in flash memory
TIP
Use strcmp_P() or similar PROGMEM-aware functions to compare keys
TIP
Values are always strings; convert to int/bool as needed in game code
Properties
| Name | Type | Description |
|---|---|---|
char | const | Attribute key (PROGMEM string, e.g., "type", "solid") |
