Card creation

This commit is contained in:
Rendo 2025-11-19 22:29:51 +05:00
commit c609a7d602

View file

@ -17,13 +17,34 @@ pub fn on_create_card(
atlas_layout: Res<LofparaAtlasLayout>, atlas_layout: Res<LofparaAtlasLayout>,
atlas_sprite: Res<LofparaAtlasImage>, atlas_sprite: Res<LofparaAtlasImage>,
) { ) {
if let Some(parent) = event.parent {
commands.spawn(( commands.spawn((
Card, Card,
Transform::from_xyz(0., 0., 0.), Transform::from_xyz(0., 0., 0.),
/*Sprite { Sprite {
image: atlas_sprite.get(), image: atlas_sprite.get(),
image_mode: SpriteImageMode::Auto, image_mode: SpriteImageMode::Auto,
texture_atlas: Some(TextureAtlas { layout: , index: () }) texture_atlas: Some(TextureAtlas {
},*/ layout: atlas_layout.get(),
index: 0,
}),
..default()
},
ChildOf(parent),
)); ));
} else {
commands.spawn((
Card,
Transform::from_xyz(0., 0., 0.),
Sprite {
image: atlas_sprite.get(),
image_mode: SpriteImageMode::Auto,
texture_atlas: Some(TextureAtlas {
layout: atlas_layout.get(),
index: 0,
}),
..default()
},
));
}
} }