Local scale factor for Bevy UI.
Attach UiLocalScale to a UI node to multiply the ComputedUiRenderTargetInfo
scale factor used by that node and its descendants. This lets a subtree keep
sharp rasterized text or images when it is visually enlarged with UiTransform.
use bevy::prelude::*;
use bevy_ui_local_scale::{UiLocalScale, UiLocalScalePlugin};
fn main() {
App::new()
.add_plugins((DefaultPlugins, UiLocalScalePlugin))
.run();
}
fn spawn_text(mut commands: Commands) {
commands.spawn((
Text::new("Scaled up"),
TextFont {
font_size: 16.,
..default()
},
UiLocalScale(4.),
));
}