Card creation
This commit is contained in:
parent
47972f0f6c
commit
c609a7d602
1 changed files with 30 additions and 9 deletions
|
|
@ -17,13 +17,34 @@ pub fn on_create_card(
|
|||
atlas_layout: Res<LofparaAtlasLayout>,
|
||||
atlas_sprite: Res<LofparaAtlasImage>,
|
||||
) {
|
||||
if let Some(parent) = event.parent {
|
||||
commands.spawn((
|
||||
Card,
|
||||
Transform::from_xyz(0., 0., 0.),
|
||||
/*Sprite {
|
||||
Sprite {
|
||||
image: atlas_sprite.get(),
|
||||
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()
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue