Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bevy 0.14 #4

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Bevy 0.14 #4

wants to merge 14 commits into from

Conversation

AmonDeShir
Copy link

@AmonDeShir AmonDeShir commented Sep 19, 2024

I bumped Bevy to 0.14.

Since 0.14 Bevy no longer re-exports thiserror, I added it to the crate dependencies. Additionally, Bevy has changed how the BackgroundColor component works. BackgroundColor no longer tints the color of images in ImageBundle. I updated the alpha demo so that alpha is adjusted based on the component combination: if an entity has a UIImage component, the color is set on it; if not, the BackgroundColor component is updated.

I added support for border-color and border-radius properties, and renamed border to border-width to keep things consistent.

I also simplified the usage of hot reload. It is now enabled automatically when Bevy's file_watcher feature is enabled. As a result, I removed the hot_reload example since it is no longer needed.

There was a bug (I think only in 0.14) where the game occasionally failed to load a CSS asset at startup, resulting in the following error:

tomt_bevycss::system: Failed to load stylesheet from handle StrongHandle<StyleSheetAsset>{ id: Index(AssetIndex { generation: 0, index: 0 }), path: Some(sheets/index.css) }

This issue was related to the loading order of systems. Moving the entire schedule right after the update phase resolved the problem. I adapted this fix from the zmbush fork, and I think it would be nice to credit her in the README.

With these changes and minor fixes in the crate code, all examples now run successfully.

- Fixed an error where the application failed to load a CSS asset, resulting in the error:
`tomt_bevycss::system: Failed to load stylesheet from handle StrongHandle<StyleSheetAsset>{ id: Index(AssetIndex { generation: 0, index: 0 }), path: Some(sheets/index.css) }`.
The issue was related to the loading order of systems. Moving the entire schedule right after the update phase resolved the problem.

- Make hot reload enabled when Bevy has the file_watcher feature enabled.
- Updated the alpha demo: due to commit bevyengine/bevy#14017, an image can now have a BackgroundColor. The fix ensures alpha is adjusted based on the component combination: if an entity has a UIImage component, the alpha is set on it; if not, the BackgroundColor component is updated.
@AmonDeShir AmonDeShir changed the title 0.14 Bevy 0.14 Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant