Asset preload structures and their impls
This commit is contained in:
parent
367359e47f
commit
1cdd4efd78
5 changed files with 125 additions and 5 deletions
33
src/lib.rs
33
src/lib.rs
|
|
@ -13,16 +13,44 @@ pub mod hand;
|
|||
pub mod animal;
|
||||
pub mod properties;
|
||||
pub mod plugins;
|
||||
pub mod asset_preloader;
|
||||
|
||||
#[derive(Component)]
|
||||
/*#[derive(Component)]
|
||||
pub struct JustUpdated;
|
||||
|
||||
#[derive(Resource)]
|
||||
pub struct Systems {
|
||||
pub update_hand_dimensions: SystemId
|
||||
}*/
|
||||
|
||||
pub fn setup(mut commands: Commands,asset_server: Res<AssetServer>) {
|
||||
let hand_img: Handle<Image> = asset_server.load("sprites/hand_9s.png");
|
||||
|
||||
commands.spawn(Camera2d);
|
||||
commands.spawn(
|
||||
(
|
||||
Hand{name: "Rendo".to_string()},
|
||||
Sprite {
|
||||
image: hand_img,
|
||||
image_mode: SpriteImageMode::Sliced(TextureSlicer {
|
||||
border: BorderRect::square(4.),
|
||||
center_scale_mode: SliceScaleMode::Stretch,
|
||||
sides_scale_mode: SliceScaleMode::Stretch,
|
||||
..default()
|
||||
}),
|
||||
..default()
|
||||
},
|
||||
Transform::from_xyz(0., -300., 0.)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
pub fn setup(
|
||||
pub fn setup_board()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*pub fn setup(
|
||||
mut commands: Commands,
|
||||
asset_server: Res<AssetServer>,
|
||||
) {
|
||||
|
|
@ -101,3 +129,4 @@ pub fn update_hand_dimensions(
|
|||
hand.1.custom_size = Some(Vec2::new(hand_total_width, hand_height));
|
||||
commands.entity(hand.0).remove::<JustUpdated>();
|
||||
}
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue