pub struct SfEgui { /* private fields */ }
Expand description
Egui
integration for SFML.
Implementations
sourceimpl SfEgui
impl SfEgui
sourcepub fn new(window: &RenderWindow) -> Self
pub fn new(window: &RenderWindow) -> Self
Create a new SfEgui
.
The size of the egui ui will be the same as window
’s size.
sourcepub fn add_event(&mut self, event: &Event)
pub fn add_event(&mut self, event: &Event)
Convert an SFML event into an egui event and add it for later use by egui.
Call this in an event polling loop for each event.
sourcepub fn do_frame(&mut self, f: impl FnOnce(&Context)) -> Result<(), DoFrameError>
pub fn do_frame(&mut self, f: impl FnOnce(&Context)) -> Result<(), DoFrameError>
Does an egui frame with a user supplied ui function.
The f
parameter is a user supplied ui function that does the desired ui
sourcepub fn draw(
&mut self,
window: &mut RenderWindow,
user_tex_src: Option<&mut dyn UserTexSource>
)
pub fn draw(
&mut self,
window: &mut RenderWindow,
user_tex_src: Option<&mut dyn UserTexSource>
)
Draw the ui to a RenderWindow
.
Takes an optional UserTexSource
to act as a user texture source.
Auto Trait Implementations
impl !RefUnwindSafe for SfEgui
impl !Send for SfEgui
impl !Sync for SfEgui
impl Unpin for SfEgui
impl !UnwindSafe for SfEgui
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more