~starkingdoms/starkingdoms

ref: ea95cf279b1c21687826debb5db825fa057e6d3b starkingdoms/starkingdoms-client/src/ecs.rs -rw-r--r-- 615 bytes
ea95cf27 — core new rendering infrastructure beginnings 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: f64,
    pub y: f64
}
#[derive(Component, Debug, Clone, Copy)]
pub struct Scale {
    pub width: f64,
    pub height: f64,
}

#[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: f64,
    pub y: f64,
    pub zoom: f64
}