|
|
|
@ -18,7 +18,7 @@ pub(crate) struct DebugText;
|
|
|
|
fn init_ui(mut commands: Commands) {
|
|
|
|
fn init_ui(mut commands: Commands) {
|
|
|
|
commands
|
|
|
|
commands
|
|
|
|
.spawn((
|
|
|
|
.spawn((
|
|
|
|
Sprite::from_color(Color::BLACK.with_alpha(0.9), [100.0, 100.0].into()),
|
|
|
|
Sprite::from_color(Color::BLACK.with_alpha(0.9), [250.0, 150.0].into()),
|
|
|
|
DebugText,
|
|
|
|
DebugText,
|
|
|
|
Visibility::Hidden,
|
|
|
|
Visibility::Hidden,
|
|
|
|
Transform::default().with_translation(Vec3::new(0.0, 0.0, 1.0)),
|
|
|
|
Transform::default().with_translation(Vec3::new(0.0, 0.0, 1.0)),
|
|
|
|
@ -42,7 +42,7 @@ fn track_card_info(
|
|
|
|
let p = trigger.pointer_location.position;
|
|
|
|
let p = trigger.pointer_location.position;
|
|
|
|
transforms.iter_mut().for_each(|mut t| {
|
|
|
|
transforms.iter_mut().for_each(|mut t| {
|
|
|
|
let offset = window.single().resolution.size() / 2.0;
|
|
|
|
let offset = window.single().resolution.size() / 2.0;
|
|
|
|
let pos = p - offset + Vec2::new(-50.0, 50.0);
|
|
|
|
let pos = p - offset + Vec2::new(-125.0, 75.0);
|
|
|
|
t.translation.x = pos.x;
|
|
|
|
t.translation.x = pos.x;
|
|
|
|
t.translation.y = -pos.y;
|
|
|
|
t.translation.y = -pos.y;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -56,7 +56,7 @@ pub(crate) fn set_debug_card(
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
let card = cards.get(trigger.entity()).unwrap();
|
|
|
|
let card = cards.get(trigger.entity()).unwrap();
|
|
|
|
debug_text.iter_mut().for_each(|mut text| {
|
|
|
|
debug_text.iter_mut().for_each(|mut text| {
|
|
|
|
text.0 = format!("{}", card);
|
|
|
|
text.0 = format!("{:#?}", card);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
vis.iter_mut().for_each(|mut v| {
|
|
|
|
vis.iter_mut().for_each(|mut v| {
|
|
|
|
*v = Visibility::Inherited;
|
|
|
|
*v = Visibility::Inherited;
|
|
|
|
|