use bevy_ecs::prelude::*;
use glam::Vec2;
#[derive(Resource, Clone, Copy, Debug, Default)]
pub struct CursorPosition {
pub x: f32,
pub y: f32,
}
#[derive(Resource, Clone, Copy, Debug, Default)]
pub struct MouseInput {
pub left_down: bool,
pub just_pressed: bool,
pub just_released: bool,
pub right_down: bool,
pub middle_down: bool,
pub scroll: f32,
pub motion: Vec2,
}
#[derive(Resource, Clone, Copy, Debug)]
pub struct ScreenSize {
pub width: f32,
pub height: f32,
}
impl Default for ScreenSize {
fn default() -> Self {
Self {
width: 800.0,
height: 600.0,
}
}
}
#[derive(Resource, Clone, Copy, Debug, Default)]
pub struct PointerCapture {
pub over_panel: bool,
}
impl PointerCapture {
pub fn taken(self) -> bool {
self.over_panel
}
}