pub struct SfEgui { /* private fields */ }
Expand description
Egui
integration for SFML.
Implementations§
source§impl 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.