-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
register TextLayoutInfo
and TextFlags
type.
#9919
Conversation
derive `Reflect` to `GlyphAtlasInfo`,`PositionedGlyph` and `TextLayoutInfo`.
TextLayoutInfo
and TextFlags
.TextLayoutInfo
and TextFlags
type.
@@ -13,6 +13,7 @@ pub mod widget; | |||
|
|||
use bevy_derive::{Deref, DerefMut}; | |||
use bevy_reflect::Reflect; | |||
use bevy_text::TextLayoutInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use bevy_text::TextLayoutInfo; | |
#[cfg(feature = "bevy_text")] | |
use bevy_text::TextLayoutInfo; |
crates/bevy_ui/src/lib.rs
Outdated
.register_type::<TextLayoutInfo>() | ||
.register_type::<TextFlags>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add those conditionally.
To check your changes, use the cargo check -p bevy_ui --no-default-features
command
I also need this, I'd like if this got merged. Could you please address the comments? |
Ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, works correctly with the text feature disabled.
This wasn't done before because when I implemented TextFlags
I was still afraid of touching anything to do with reflection 😅
The UI example and Text with scale factor is broken again 😓 but it's broken in Main as well so nothing to do with this PR.
derive `Reflect` to `GlyphAtlasInfo`,`PositionedGlyph` and `TextLayoutInfo`. # Objective - I need reflection gets all components of the `TextBundle` and `clone_value` it ## Solution - registry it
derive
Reflect
toGlyphAtlasInfo
,PositionedGlyph
andTextLayoutInfo
.Objective
TextBundle
andclone_value
itSolution