Weasy666 / bevy_svg

A simple and incomplete SVG drawer for the Bevy engine.
Apache License 2.0
108 stars 26 forks source link

Svg is made visible on load #5

Closed zbrachinara closed 2 years ago

zbrachinara commented 2 years ago

Sorry if this is against guidelines, I'm relatively new to using Bevy and this is my first issue.

When I spawn in a new SvgBundle with this plugin, it is set to visible whether or not I set it invisible. I got around this by adding a new stage and setting all of the newly added Svg entities to be invisible there. However, when I do this, the texture flashes on the screen and then becomes hidden. I would like for it to be hidden in the first place.

If I'm understanding correctly, then what's causing this to happen is on the end of the svg_mesh_maker function, where the entity visibility is set to true (https://github.com/Weasy666/bevy_svg/blob/main/src/plugin.rs#L148). Is there anything more to this? If not, can it be fixed?

Thanks.

Weasy666 commented 2 years ago

No worries. I am happy when people open issues, that means they use this plugin 😬. Thanks for searching a bit for the problem yourself. I'll take a look at it and see why SvgBundle.visible is ignored. I'll hopefully come around to that tomorrow or on the weekend.

Weasy666 commented 2 years ago

Should be fixed with fd04006. @zbrachinara can you test this with your project? If this works for you, then i will publish a new version to crates.io.

zbrachinara commented 2 years ago

I tried to use the main branch, but I keep getting a dependency issue. Here is my Cargo.toml:

[dependencies]
# bevy = { version = "0.5.0", features = [ "dynamic" ] }
bevy = { git = "https://github.com/bevyengine/bevy", rev = "65e834ce8d5142f1a01d06c2a9e4e7ef4a1238a9"}
bevy_svg = { git = "https://github.com/Weasy666/bevy_svg", rev = "fd04006020c828fe500c6f787657645ddec92a6a" }
array2d = "*"

Here is the conflict:

error: failed to select a version for `syn`.
    ... required by package `wasm-bindgen-macro-support v0.2.76`
    ... which satisfies dependency `wasm-bindgen-macro-support = "=0.2.76"` of package `wasm-bindgen-macro v0.2.76`
    ... which satisfies dependency `wasm-bindgen-macro = "=0.2.76"` of package `wasm-bindgen v0.2.76`
    ... which satisfies dependency `wasm-bindgen = "^0.2.76"` of package `wgpu v0.11.0`
    ... which satisfies dependency `wgpu = "^0.11.0"` of package `bevy_gltf2 v0.5.0 (https://github.com/bevyengine/bevy?rev=65e834ce8d5142f1a01d06c2a9e4e7ef4a1238a9#65e834ce)`
    ... which satisfies git dependency `bevy_gltf2` of package `bevy_internal v0.5.0 (https://github.com/bevyengine/bevy?rev=65e834ce8d5142f1a01d06c2a9e4e7ef4a1238a9#65e834ce)`
    ... which satisfies git dependency `bevy_internal` of package `bevy v0.5.0 (https://github.com/bevyengine/bevy?rev=65e834ce8d5142f1a01d06c2a9e4e7ef4a1238a9#65e834ce)`
    ... which satisfies git dependency `bevy` of package `tic-tac-toe v0.1.0 (/home/zeskomer/IdeaProjects/tic-tac-toe)`
versions that meet the requirements `^1.0.67` are: 1.0.82, 1.0.81, 1.0.80, 1.0.79, 1.0.78, 1.0.77, 1.0.76, 1.0.75, 1.0.74, 1.0.73, 1.0.72, 1.0.71, 1.0.70, 1.0.69, 1.0.68, 1.0.67

all possible versions conflict with previously selected packages.

  previously selected package `syn v1.0.65`
    ... which satisfies dependency `syn = "=1.0.65"` of package `bevy v0.5.0`
    ... which satisfies dependency `bevy = "^0.5"` of package `bevy_svg v0.3.1 (https://github.com/Weasy666/bevy_svg?rev=fd04006020c828fe500c6f787657645ddec92a6a#fd040060)`
    ... which satisfies git dependency `bevy_svg` of package `tic-tac-toe v0.1.0 (/home/zeskomer/IdeaProjects/tic-tac-toe)`

failed to select a version for `syn` which could resolve this conflict
Weasy666 commented 2 years ago

Ah...main branch is for tracking bevy main branch...but i haven't had the time to update it to the new renderer. You need to use bevy-0.5 branch with bevy 0.5. If you want to try with main branch, i did change the rust edition from 2018 to 2021, so you need to cargo clean and cargo update. Rust 2021 also needs at least rustc version 1.56.

zbrachinara commented 2 years ago

Everything works now for me, thanks!

Weasy666 commented 2 years ago

Great! I have published version 0.3.2 to crates.io.