Trouv / bevy_ecs_ldtk

ECS-friendly ldtk plugin for bevy, leveraging bevy_ecs_tilemap
Other
672 stars 76 forks source link

Error mismatched types when compiling bevy_ecs_ldtk #313

Closed Ggcpp closed 6 months ago

Ggcpp commented 6 months ago

I tried to use bevy_ecs_ldtk for the first time but can't compile it due to multiple mismatched types error like :

209 |               color: TileColor(
    |                      --------- arguments to this struct are incorrect
210 | /                 *color_map
211 | |                     .get(&value)
212 | |                     .expect("Int grid values should have an associated IntGridValueDefinition"),
    | |_______________________________________________________________________________________________^ expected `bevy_render::color::Color`, found `bevy::prelude::Color`
    |
    = note: `bevy::prelude::Color` and `bevy_render::color::Color` have similar names, but are actually distinct types
note: `bevy::prelude::Color` is defined in crate `bevy_render`

I use bevy 0.13 and and the main branch of bevy_ecs_ldtk so it should be compatible :

[package]
name = "package_name"
version = "0.1.0"
edition = "2021"

[profile.dev]
opt-level = 1

[profile.dev.package."*"]
opt-level = 3

[dependencies]
bevy = { version = "0.13", features = ["dynamic_linking"] }
bevy_ecs_ldtk = { git = "https://github.com/Trouv/bevy_ecs_ldtk.git" , branch = "main" }

Are you already aware of the issue or am I doing something wrong? The examples work btw, I might do something wrong...

P.S. Thanks for making an LDtk plugin to the bevy ecosystem :)

roosta commented 6 months ago

You need the latest version of bevy_ecs_tilemap, add this to your Cargo.toml to patch it in:

[patch.crates-io]
bevy_ecs_tilemap = { git = "https://github.com/StarArawn/bevy_ecs_tilemap" }
Ggcpp commented 6 months ago

It works thanks!