pub struct Scheme {Show 13 fields
pub jump: &'static [Key],
pub jump_pad: &'static [Button],
pub dash: &'static [Key],
pub dash_pad: &'static [Button],
pub grab: &'static [Key],
pub grab_pad: &'static [Button],
pub cast: &'static [Key],
pub cast_pad: &'static [Button],
pub sprint: &'static [Key],
pub sprint_pad: &'static [Button],
pub super_dash: &'static [Key],
pub super_dash_pad: &'static [Button],
pub custom: Cow<'static, [Custom]>,
}Expand description
Which keys and buttons do what. An action with no keys and no buttons can’t be done.
Fields§
§jump: &'static [Key]Jump keys.
jump_pad: &'static [Button]Jump buttons.
dash: &'static [Key]Dash keys.
dash_pad: &'static [Button]Dash buttons.
grab: &'static [Key]Grab keys (held).
grab_pad: &'static [Button]Grab buttons (held).
cast: &'static [Key]Cast keys: with down held, a dive.
cast_pad: &'static [Button]Cast buttons.
sprint: &'static [Key]Sprint keys (held).
sprint_pad: &'static [Button]Sprint buttons (held).
super_dash: &'static [Key]Super dash keys (held).
super_dash_pad: &'static [Button]Super dash buttons (held).
custom: Cow<'static, [Custom]>Your game’s own buttons, read into Intent::custom and
Intent::custom_pressed. The built-in schemes have none; add yours with
Scheme { custom: Cow::Borrowed(&[...]), ..Scheme::SNAPPY }, or at runtime (a
key-rebinding menu) with Scheme::bind.
Implementations§
Source§impl Scheme
impl Scheme
Sourcepub const SNAPPY: Scheme
pub const SNAPPY: Scheme
After Hollow Knight’s default layout, plus grab and sprint. The hybrid, snappy and drifter presets’ scheme.
Sourcepub const MOMENTUM: Scheme
pub const MOMENTUM: Scheme
After Super Meat Boy’s: jump, and hold to run. The momentum preset’s scheme.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scheme
impl RefUnwindSafe for Scheme
impl Send for Scheme
impl Sync for Scheme
impl Unpin for Scheme
impl UnsafeUnpin for Scheme
impl UnwindSafe for Scheme
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.