bevy_tiled_blueprints

Crates.iobevy_tiled_blueprints
lib.rsbevy_tiled_blueprints
version0.1.0
sourcesrc
created_at2024-02-12 22:40:39.007135
updated_at2024-02-12 22:40:39.007135
descriptionAllows reading tiled maps with properties
homepagehttps://github.com/Leinnan/bevy_tiled_blueprints
repositoryhttps://github.com/Leinnan/bevy_tiled_blueprints
max_upload_size
id1137383
size185,303
MevLyshkin (Leinnan)

documentation

README

Bevy Tiled Blueprints

Ability to read properties from Tiled maps objects straight into Bevy Engine.

Install

cargo add bevy_tiled_blueprints --git "https://github.com/Leinnan/bevy_tiled_blueprints"

simple example

Tiled example

Usage

Tiled Bevy
Object Entity
object.name Name component
Custom property Component
Custom property name Component struct name
Custom property value Component serialized in ron format

Supported custom property values:

  • empty for unit-like structs without any fields
  • int/bool/float for tuple structs with one unnamed fields
  • ron strings for regular structs
  • string properties for enum components
  • string properties with names with prefixes remove: like remove:{NameOfComponent} for removing components.

Custom properties added to the layer or the map itself would be added in the same way to the corresponding entities.

Usage

Debug rendering of Objects placement can be enabled by adding TiledBlueprintsDebugDisplayPlugin plugin to the application. There is example in examples/simple.rs.

ToDo

  • parse different object shapes, for now it just takes x and y pos and turns that into Tranform components
  • make example with support for collisions from bevy_rapier for example
  • create workflow for using Custom enums and classes from Tiled. Best case scenario- with provided relative path to Tiled project file on game build bevy feeds data about custom properties to project file. It would also require improvements in tiled crate
  • support for object and file property values.

Big thanks to the authors of bevy_ecs_tilemap, this whole thing is based on expanding the tiled example from there. Same thanks to the authors of Blender_bevy_components_workflow.


Web example has issues with rendering but if you look into console you can see it works.

Contributing

Got some idea, feedback, question or found any bug? Feel free to open an issue at any time!

Commit count: 0

cargo fmt