WIP scaling without breaking font rendering, too
This commit is contained in:
parent
4c7e259537
commit
f9bedc374e
|
@ -3,7 +3,7 @@ use bevy::render::camera::Camera;
|
||||||
|
|
||||||
pub fn startup(mut commands: Commands) {
|
pub fn startup(mut commands: Commands) {
|
||||||
let mut bundle = (Camera2dBundle::default(), IsDefaultUiCamera);
|
let mut bundle = (Camera2dBundle::default(), IsDefaultUiCamera);
|
||||||
bundle.0.projection.scale = 0.5;
|
// bundle.0.projection.scale = 1;
|
||||||
commands.spawn(bundle);
|
commands.spawn(bundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub fn startup(mut commands: Commands, assets: Res<AssetLoader>) {
|
||||||
"Text Example\nPress ENTER to play",
|
"Text Example\nPress ENTER to play",
|
||||||
TextStyle {
|
TextStyle {
|
||||||
font: assets.fonts.iosevkalytemin.clone(),
|
font: assets.fonts.iosevkalytemin.clone(),
|
||||||
font_size: 30.0,
|
font_size: 100.0,
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -29,36 +29,35 @@ pub fn startup(
|
||||||
let listener = SpatialListener::new(1.);
|
let listener = SpatialListener::new(1.);
|
||||||
|
|
||||||
commands
|
commands
|
||||||
.spawn((
|
.spawn((Player, YSortable, Watched))
|
||||||
Player,
|
|
||||||
YSortable,
|
|
||||||
Watched,
|
|
||||||
SpriteSheetBundle {
|
|
||||||
texture,
|
|
||||||
atlas: assets.images.player.clone().into(),
|
|
||||||
sprite: Sprite::default(),
|
|
||||||
..default()
|
|
||||||
},
|
|
||||||
Mover {
|
|
||||||
velocity: Velocity(Vec2::ZERO),
|
|
||||||
heading: Heading(Vec2::ZERO),
|
|
||||||
speed: Speed(PLAYER_SPEED),
|
|
||||||
},
|
|
||||||
))
|
|
||||||
.with_children(|player| {
|
.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()
|
||||||
|
},
|
||||||
|
Mover {
|
||||||
|
velocity: Velocity(Vec2::ZERO),
|
||||||
|
heading: Heading(Vec2::ZERO),
|
||||||
|
speed: Speed(PLAYER_SPEED),
|
||||||
|
},
|
||||||
|
));
|
||||||
player.spawn((SpatialBundle::default(), listener.clone()));
|
player.spawn((SpatialBundle::default(), listener.clone()));
|
||||||
player.spawn(TextBundle {
|
player.spawn(Text2dBundle {
|
||||||
text: Text::from_section(
|
text: Text::from_section(
|
||||||
"You",
|
"You",
|
||||||
TextStyle {
|
TextStyle {
|
||||||
font_size: 100.0,
|
font_size: 11.0,
|
||||||
font: assets.fonts.iosevkalytemin.clone(),
|
font: assets.fonts.iosevkalytemin.clone(),
|
||||||
color: Color::WHITE,
|
color: Color::WHITE,
|
||||||
..Default::default()
|
..default()
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
transform: Transform::from_translation(Vec3::new(30.0, -30.0, -1000.0)),
|
transform: Transform::from_translation(Vec3::new(30.0, -30.0, 0.)),
|
||||||
..Default::default()
|
..default()
|
||||||
});
|
});
|
||||||
|
|
||||||
let mesh = Mesh2dHandle(meshes.add(Capsule2d::new(3.0, 25.0)));
|
let mesh = Mesh2dHandle(meshes.add(Capsule2d::new(3.0, 25.0)));
|
||||||
|
|
Loading…
Reference in a new issue