pub struct EngineWrapper(/* private fields */);
Expand description
A Wrapper around an Engine
Implementations§
Source§impl EngineWrapper
impl EngineWrapper
Sourcepub async fn new(title: String, size: (u32, u32, u32)) -> Self
pub async fn new(title: String, size: (u32, u32, u32)) -> Self
Create the Engine and the Wrapper
Sourcepub fn new_sync(title: String, size: (u32, u32, u32)) -> Self
pub fn new_sync(title: String, size: (u32, u32, u32)) -> Self
Create the Engine and the Wrapper
Methods from Deref<Target = Engine>§
Sourcepub fn get_mouse_btn(&self, btn: MouseBtn) -> Input
pub fn get_mouse_btn(&self, btn: MouseBtn) -> Input
Get the status of a Mouse Button
Sourcepub fn get_mouse_location(&self) -> Vu2d
pub fn get_mouse_location(&self) -> Vu2d
Get the mouse location (in pixel) on the screen Will be defaulted to (0,0) at the start of the program
Sourcepub fn get_mouse_wheel(&self) -> MouseWheel
pub fn get_mouse_wheel(&self) -> MouseWheel
Get the scroll wheel direction (If Any) during the frame
Sourcepub fn get_pressed(&self) -> HashSet<Keycodes>
pub fn get_pressed(&self) -> HashSet<Keycodes>
Get all Keys pressed during the last frame
Sourcepub fn get_held(&self) -> HashSet<Keycodes>
pub fn get_held(&self) -> HashSet<Keycodes>
Get all the keys that were held during the last frame
Sourcepub fn get_released(&self) -> HashSet<Keycodes>
pub fn get_released(&self) -> HashSet<Keycodes>
Get all the keys that were released during the last frame
Sourcepub fn create_decal(&mut self, sprite: &Sprite) -> Decal
pub fn create_decal(&mut self, sprite: &Sprite) -> Decal
Create a GPU version of Sprite
Sourcepub fn clear_input_buffer(&mut self)
pub fn clear_input_buffer(&mut self)
Will clear the input buffer and set the cursor to 0
Sourcepub fn set_input_buffer(&mut self, value: impl AsRef<str>)
pub fn set_input_buffer(&mut self, value: impl AsRef<str>)
Set the input buffer to the desired value and put the input cursor at the end of the text
§Warning
The value must be an ascii string
Sourcepub fn insert_input_buffer(&mut self, value: impl AsRef<str>)
pub fn insert_input_buffer(&mut self, value: impl AsRef<str>)
Insert the given string into the input buffer at the input cursor
§Warning
if the string is not only ASCII characters it will silently do nothing
Sourcepub fn append_input_buffer(&mut self, value: impl AsRef<str>)
pub fn append_input_buffer(&mut self, value: impl AsRef<str>)
Append the given string onto the input buffer
§Warning
if the string is not only ASCII characters it will silently do nothing
Sourcepub fn add_input_passthrough(
&mut self,
iterator: impl Iterator<Item = Keycodes>,
)
pub fn add_input_passthrough( &mut self, iterator: impl Iterator<Item = Keycodes>, )
Add keys onto the input pass through list
Sourcepub fn remove_input_passthrough(
&mut self,
iterator: impl Iterator<Item = Keycodes>,
)
pub fn remove_input_passthrough( &mut self, iterator: impl Iterator<Item = Keycodes>, )
Remove keys onto the input pass through list
Sourcepub fn set_input_passthrough(
&mut self,
iterator: impl Iterator<Item = Keycodes>,
)
pub fn set_input_passthrough( &mut self, iterator: impl Iterator<Item = Keycodes>, )
Set the input to the iterator
Sourcepub fn set_ignore_passthrough_chars(&mut self, val: bool)
pub fn set_ignore_passthrough_chars(&mut self, val: bool)
If set to true, any key that is passed through when in input mode won’t have the char appended to the input buffer
Sourcepub fn get_input_buffer(&self) -> &str
pub fn get_input_buffer(&self) -> &str
Return a view into the input buffer
Sourcepub fn get_input_cursor(&self) -> usize
pub fn get_input_cursor(&self) -> usize
Return the input cursor
Sourcepub fn start_input(&mut self)
pub fn start_input(&mut self)
Switch to text input mode, return true if it wasn’t in this mode before
Sourcepub fn force_stop_input_mode(&mut self)
pub fn force_stop_input_mode(&mut self)
This will clear the input buffer, reset the input cursor and stop the input mode
Sourcepub fn is_in_input_mode(&self) -> bool
pub fn is_in_input_mode(&self) -> bool
Is the engine in input mode
Sourcepub fn end_input_mode(&mut self) -> &str
pub fn end_input_mode(&mut self) -> &str
Stop the input mode right there, and return a &str to the current buffer. This is if you need to leave the mode but retain the input buffer for a later re-entry
Trait Implementations§
Source§impl Debug for EngineWrapper
impl Debug for EngineWrapper
Source§impl Deref for EngineWrapper
impl Deref for EngineWrapper
Auto Trait Implementations§
impl !Freeze for EngineWrapper
impl !RefUnwindSafe for EngineWrapper
impl !Send for EngineWrapper
impl !Sync for EngineWrapper
impl Unpin for EngineWrapper
impl !UnwindSafe for EngineWrapper
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more