Skip to content

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
@TheBeardedQuack
Copy link
Owner

TheBeardedQuack commented Dec 6, 2025

Been evaluating this commit and the update to bevy 0.14 appears to have broken some UI layout (at least on theme example). However I've also performed the update from scratch and I'm also running into the same issue.

For now I'm tempted to accept this proposal, and crack on with continuing to catch up on the bevy version (the issue might fix if the source is a bevy UI bug, or just as bevy UI changes more in future crates).

I've opened an issue myself for creating a HTML reference of each example. With a reference to compare against, I can look at making sure the CSS is being applied accurately (and preventing future updates causing UI changes).

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.

2 participants