pub struct MenuLayout {
pub position: TilePos,
pub size: TileRect,
pub option_spacing: u32,
pub show_cursor: bool,
}Expand description
Fields§
§position: TilePosScreen position of the menu (top-left corner of the border box in tile coordinates).
size: TileRectSize of the menu box including its border (in tile units).
option_spacing: u32Vertical spacing between option rows (in tile units). Typically
2 for single-spaced lists.
show_cursor: boolIf true, draw a cursor next to the currently-selected option.
Implementations§
Source§impl MenuLayout
impl MenuLayout
Sourcepub fn new(tx: u32, ty: u32, tw: u32, th: u32) -> Self
pub fn new(tx: u32, ty: u32, tw: u32, th: u32) -> Self
Create a layout at the given tile position, with tw * th size
(INCLUDING the 1-tile border on each side).
Sourcepub fn with_spacing(self, spacing: u32) -> Self
pub fn with_spacing(self, spacing: u32) -> Self
Builder: set vertical option spacing.
Sourcepub fn with_cursor(self, show: bool) -> Self
pub fn with_cursor(self, show: bool) -> Self
Builder: show or hide the cursor indicator.
Trait Implementations§
Source§impl Clone for MenuLayout
impl Clone for MenuLayout
Source§fn clone(&self) -> MenuLayout
fn clone(&self) -> MenuLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MenuLayout
Source§impl Debug for MenuLayout
impl Debug for MenuLayout
impl Eq for MenuLayout
Source§impl PartialEq for MenuLayout
impl PartialEq for MenuLayout
impl StructuralPartialEq for MenuLayout
Auto Trait Implementations§
impl Freeze for MenuLayout
impl RefUnwindSafe for MenuLayout
impl Send for MenuLayout
impl Sync for MenuLayout
impl Unpin for MenuLayout
impl UnsafeUnpin for MenuLayout
impl UnwindSafe for MenuLayout
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