~starkingdoms/starkingdoms

ref: 28f124e8058c5af6ad245a0edfb58ab2d38c901d starkingdoms/starkingdoms-client/src/ecs.rs -rw-r--r-- 619 bytes
28f124e8 — core format 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use bevy_ecs::bundle::Bundle;
use bevy_ecs::component::Component;
use bevy_ecs::system::Resource;

#[derive(Component, Debug, Clone, Copy)]
pub struct Position {
    pub x: f32,
    pub y: f32,
}
#[derive(Component, Debug, Clone, Copy)]
pub struct Scale {
    pub width: f32,
    pub height: f32,
}

#[derive(Component, Debug, Clone)]
pub struct SpriteTexture {
    pub texture: String,
}

#[derive(Bundle)]
pub struct SpriteBundle {
    pub position: Position,
    pub scale: Scale,
    pub texture: SpriteTexture,
}

#[derive(Resource, Debug)]
pub struct Camera {
    pub x: f32,
    pub y: f32,
    pub zoom: f32,
}