seldom_pixel 0.8.0

Bevy plugin for limited color palette pixel art games
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{position::Spatial, prelude::*};

/// UI is displayed within these bounds
#[derive(Component, Deref, DerefMut, Clone, Copy, Default, Debug)]
pub struct PxRect(pub IRect);

impl From<IRect> for PxRect {
    fn from(rect: IRect) -> Self {
        Self(rect)
    }
}

impl Spatial for PxRect {
    fn frame_size(&self) -> UVec2 {
        self.size().as_uvec2()
    }
}