Comments (2)
I would much prefer other tools for composition: I have been endlessly frustrated by style-inheritance in the past due to how poorly organized and difficult to reason about it is. That said, we need to at least demonstrate patterns to show how to build and compose styles, both for text and other UI elements.
I really like the list of text properties though, and want to have first class primitives (components maybe?) for all of those so users can quickly modify one property independently.
from bevy.
@alice-i-cecile I suspect that for many users, the reason CSS inheritance is hard to understand has to do more with the rules of cascade priority (which we are not proposing to add here) than inheritance.
However, as a compromise, we could make this behavior opt-in at the entity level. That is, in order to get inheritable text styles, you would add a marker component (e.g. UseInheritedStyle
) to your Text
entity that indicates that it wants to participate in inherited styling. This marker component would be used just like any other style component.
This is still an improvement over the current situation, particularly for font families. Loading a font asset from the asset system involves a non-trivial amount of code. Since most games only use a single font family, ideally you should only have to do this once at the top level of your app. Yes, you could store the font handle in a resource and inject the resource every place you create a text span; but it would be even better not to have to do this at all. Except in the case of image assets, style properties ideally should be standalone and not require references to things other than the entity.
from bevy.
Related Issues (20)
- overflow evaluating the requirement &_: IntoIterator HOT 1
- Don't use `CARGO_MANIFEST_DIR` directly for changing the relative location of the assets directory
- bevy_ptr: unused align_of import in release mode
- overlapping viewport from different camera causes over-culling of entity rendering HOT 2
- Make `reflect::Map::drain` and `reflect::List::drain` take a mutable borrow instead of `Box<Self>`.
- Reflect derived traits on all components and resources HOT 6
- Mention `DynamicTyped` in docs
- On Steam Deck in gaming mode the screen does not update
- The program statements in the novice tutorial are no longer applicable in the latest version. It is recommended to modify them | 新手教程中的程序语句在最新版本中不在适用,建议修改。 HOT 4
- Delay in text-update vs layout-update, creating wiggling text HOT 4
- `RenderTarget::Image` doesn't support `Rgba8Unorm` and `Bgra8Unorm` texture formats (non-srgb formats)
- `HeadlessPlugins` for headless apps, rather than `MinimalPlugins` HOT 2
- Add fake variadics to `Reflect` impls
- StateScoped entity could cause "Could not despawn entity" warning HOT 3
- Example for bevy_ecs::event::Events uses deprecated function get_reader
- Add an option to disable FpsOverlayPlugin
- `bevy_color`'s operations are not stable across all hardware due to use of trigonometric float methods HOT 11
- missing_const_for_thread_local HOT 1
- bevy_reflect fails to build HOT 5
- Register asset saver? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy.