WIP scaling without breaking font rendering, too

This commit is contained in:
Daniel Flanagan 2024-07-29 17:03:26 -05:00
parent 4c7e259537
commit f9bedc374e
3 changed files with 22 additions and 23 deletions

View file

@ -3,7 +3,7 @@ use bevy::render::camera::Camera;
pub fn startup(mut commands: Commands) {
let mut bundle = (Camera2dBundle::default(), IsDefaultUiCamera);
bundle.0.projection.scale = 0.5;
// bundle.0.projection.scale = 1;
commands.spawn(bundle);
}

View file

@ -26,7 +26,7 @@ pub fn startup(mut commands: Commands, assets: Res<AssetLoader>) {
"Text Example\nPress ENTER to play",
TextStyle {
font: assets.fonts.iosevkalytemin.clone(),
font_size: 30.0,
font_size: 100.0,
..default()
},
)

View file

@ -29,12 +29,12 @@ pub fn startup(
let listener = SpatialListener::new(1.);
commands
.spawn((
Player,
YSortable,
Watched,
.spawn((Player, YSortable, Watched))
.with_children(|player| {
player.spawn((
SpriteSheetBundle {
texture,
transform: Transform::from_scale(Vec3::new(2., 2., 1.)),
atlas: assets.images.player.clone().into(),
sprite: Sprite::default(),
..default()
@ -44,21 +44,20 @@ pub fn startup(
heading: Heading(Vec2::ZERO),
speed: Speed(PLAYER_SPEED),
},
))
.with_children(|player| {
));
player.spawn((SpatialBundle::default(), listener.clone()));
player.spawn(TextBundle {
player.spawn(Text2dBundle {
text: Text::from_section(
"You",
TextStyle {
font_size: 100.0,
font_size: 11.0,
font: assets.fonts.iosevkalytemin.clone(),
color: Color::WHITE,
..Default::default()
..default()
},
),
transform: Transform::from_translation(Vec3::new(30.0, -30.0, -1000.0)),
..Default::default()
transform: Transform::from_translation(Vec3::new(30.0, -30.0, 0.)),
..default()
});
let mesh = Mesh2dHandle(meshes.add(Capsule2d::new(3.0, 25.0)));