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>,
) { ) {
commands.spawn(( if let Some(parent) = event.parent {
Card, commands.spawn((
Transform::from_xyz(0., 0., 0.), Card,
/*Sprite { Transform::from_xyz(0., 0., 0.),
image: atlas_sprite.get(), Sprite {
image_mode: SpriteImageMode::Auto, image: atlas_sprite.get(),
texture_atlas: Some(TextureAtlas { layout: , index: () }) image_mode: SpriteImageMode::Auto,
},*/ 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()
},
));
}
} }