More CSS work
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
//! Token that is used to select characters in the CSS
|
||||
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::menus::style::FGUiStyle;
|
||||
|
||||
#[derive(Component, Clone)]
|
||||
pub struct CharacterSelectToken {
|
||||
pub slot: usize,
|
||||
pub cursor: Entity
|
||||
}
|
||||
|
||||
impl CharacterSelectToken {
|
||||
pub fn create(cursor: Entity, slot: usize, style: &FGUiStyle) -> impl Bundle {
|
||||
(
|
||||
CharacterSelectToken {
|
||||
slot,
|
||||
cursor
|
||||
},
|
||||
Pickable::IGNORE,
|
||||
Node {
|
||||
position_type: PositionType::Absolute,
|
||||
width: px(64),
|
||||
height: px(64),
|
||||
..default()
|
||||
},
|
||||
ImageNode {
|
||||
image: style.css_token.handle.handle.clone(),
|
||||
..default()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user