pub struct Menu {
pub buttons: [Button; 5],
pub selected_index: usize,
pub button_count: usize,
}Fields§
§selected_index: usizeImplementations§
Source§impl Menu
impl Menu
pub fn new(start_x: usize, start_y: usize) -> Self
pub fn select(&mut self, index: usize)
pub fn move_up(&mut self)
pub fn move_down(&mut self)
pub fn render(&self, screen: &mut Screen)
pub fn handle_input(&mut self, key: &InputKey) -> Option<usize>
pub fn run(&mut self, screen: &mut Screen, keyboard: &mut Keyboard) -> usize
Auto Trait Implementations§
impl Freeze for Menu
impl RefUnwindSafe for Menu
impl Send for Menu
impl Sync for Menu
impl Unpin for Menu
impl UnwindSafe for Menu
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more