Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser
Quick Information
Implements a TileProps class for more flexible tile custom data. This allows the use of enums, meaning a tile can have a custom drop-down menu for mutually-exclusive states: e.g Floor/Wall/Door or similar.TileProps resources are automatically added to each tile on a tileset if it contains a custom data layer named 'Props' of type Object.A more detailed usage guide can be found in the README.md file.
TileProps — Flexible custom data for TileSets in Godot 4.5
A plugin for Godot designed to increase the flexibility of custom data layers.
TileSet custom data layers in Godot only support a few types, and do not support enums. TileProps solves this using a global 'TileProps' class assigned to any created tile. This allows for scriptable properties and methods for tiles, and increases readability for mutually exclusive states via enums.
Installation
- Extract the .zip from the Releases tab into your project’s addons directory (e.g
res://addons/tileprops_plugin). - Enable in [Project Settings/Plugins]
Usage
Adapt the TileProps class as necessary with any properties and methods you require. It can be edited via the tileprops.gd script. The included examples properties are:
Walkable : Boolean
Type : TileType Enum (0: None, 1: Floor, 2: Wall)
For each new or existing tilemap, create a Custom Data Layer named Props*, and set its type to Object (Important).
The plugin will then automatically populate any existing tiles’ Props field with a new TileProps resource. Your custom fields can now be edited here!
To access these properties in code, access the custom data layer as normal using the as keyword to adopt the TileProps type.
Example (GDScript):
var tile_props = example_tilemap_layer.get_cell_tile_data(coords).get_custom_data("Props") as TileProps
#Accessing properties
var is_walkable : bool = tile_props.Walkable
Example (C#):
var tileProps = exampleTileMapLayer.GetCellTileData(coords).GetCustomData("Props").As<TileProps>();
//Accessing properties
bool isWalkable = tileProps.Walkable;
*The layer name can be edited via the PROPS_FIELD_NAME constant in the tileprops_plugin.gd script.
Additional Information
Currently tested for tilesets up to 64*64 in size.
Contributions are welcome. Godot’s available EditorInterface methods and signals are somewhat lacking, meaning there are some hacks and workarounds in here that likely have more elegant solutions.
Implements a TileProps class for more flexible tile custom data. This allows the use of enums, meaning a tile can have a custom drop-down menu for mutually-exclusive states: e.g Floor/Wall/Door or similar.
TileProps resources are automatically added to each tile on a tileset if it contains a custom data layer named 'Props' of type Object.
A more detailed usage guide can be found in the README.md file.
Reviews
Quick Information
Implements a TileProps class for more flexible tile custom data. This allows the use of enums, meaning a tile can have a custom drop-down menu for mutually-exclusive states: e.g Floor/Wall/Door or similar.TileProps resources are automatically added to each tile on a tileset if it contains a custom data layer named 'Props' of type Object.A more detailed usage guide can be found in the README.md file.