Skip to content

Commit

Permalink
Fix scale in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Oct 23, 2024
1 parent 379e6dc commit 36f6f72
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions examples/player_box/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ impl PlayerBoxPlugin {
) {
for (visibility, transform, color) in &players {
if visibility != Visibility::Hidden {
const DEFAULT_SCALE: Vec2 = Vec2::splat(50.0);
gizmos.rect(
transform.translation,
transform.rotation,
transform.scale.xy(),
DEFAULT_SCALE + transform.scale.xy(),
color.0,
);
}
Expand All @@ -30,25 +31,14 @@ impl PlayerBoxPlugin {

pub(super) const DEFAULT_SPEED: f32 = 400.0;

#[derive(Bundle)]
#[derive(Bundle, Default)]
pub(super) struct PlayerBoxBundle {
pub(super) color: PlayerColor,
pub(super) visibility: Visibility,
pub(super) player: PlayerBox,
pub(super) transform: Transform,
}

impl Default for PlayerBoxBundle {
fn default() -> Self {
Self {
color: Default::default(),
visibility: Default::default(),
player: Default::default(),
transform: Transform::from_scale(Vec3::splat(50.0)),
}
}
}

#[derive(Component, Default)]
pub(super) struct PlayerBox;

Expand Down

0 comments on commit 36f6f72

Please sign in to comment.