Skip to content

ickshonpe/bevy_ui_local_scale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bevy_ui_local_scale

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.),
    ));
}

About

Local scale factor for Bevy UI nodes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages