Bevy version and features
- Using bevy 0.19.0, with
bevy_feathers feature.
What you did
I wanted feather buttons with bigger font, so I tried to override the InheritableFont for my button :
#[derive(SceneComponent, Default, Clone)]
#[scene(MyButtonProps)]
pub struct MyButton;
impl MyButton {
fn scene(props: MyButtonProps) -> impl Scene {
bsn! {
@FeathersButton {
@caption: bsn! { Text({props.label}) }
}
InheritableFont {
font_size: px(32),
weight: FontWeight::SEMIBOLD,
}
BorderColor::all(BUTTON_BORDER_COLOR)
}
}
}
What went wrong
I don't fully understand how bsn! macro works, but I supposed that it would patch the InheritableFont from FeathersButton, but the button text font still use the feather configuration instead of the one I provide.
Using bevy-egui-inspector, I can see that the InheritableFont component is correctly set for MyButton. Looking to \bevy_feathers-0.19.0\src\font_styles.rs, I can see that the on_changed_font system is called only on the insertion of the InheritableFont component. So, I suppose that the bsn! macro first insert the InheritableFont component, and then replace it later. This might be Looking to \bevy_feathers-0.19.0\src\font_styles.rs.
Is there a way do change the feather button font ? Is it possible to add an observer to also replace the Propagate component on Replace ? Or do I have to change the way to create my own button ?
Bevy version and features
bevy_feathersfeature.What you did
I wanted feather buttons with bigger font, so I tried to override the
InheritableFontfor my button :What went wrong
I don't fully understand how
bsn!macro works, but I supposed that it would patch theInheritableFontfromFeathersButton, but the button text font still use the feather configuration instead of the one I provide.Using bevy-egui-inspector, I can see that the
InheritableFontcomponent is correctly set for MyButton. Looking to\bevy_feathers-0.19.0\src\font_styles.rs, I can see that theon_changed_fontsystem is called only on the insertion of theInheritableFontcomponent. So, I suppose that thebsn!macro first insert theInheritableFontcomponent, and then replace it later. This might be Looking to\bevy_feathers-0.19.0\src\font_styles.rs.Is there a way do change the feather button font ? Is it possible to add an observer to also replace the
Propagatecomponent onReplace? Or do I have to change the way to create my own button ?