pub struct RaylibGui {
pub context: Context,
/* private fields */
}
Fields§
§context: Context
Implementations§
Source§impl RaylibGui
impl RaylibGui
Sourcepub fn new(rl: &mut RaylibHandle, _thread: &RaylibThread) -> RaylibGui
pub fn new(rl: &mut RaylibHandle, _thread: &RaylibThread) -> RaylibGui
Examples found in repository?
examples/raylib_draw_extension.rs (line 20)
14fn main() {
15 let (mut rl, thread) = raylib::init()
16 .size(800, 600)
17 .title("Using raylib draw")
18 .build();
19
20 let mut gui = RaylibGui::new(&mut rl, &thread);
21 let mut open = true;
22
23 while !rl.window_should_close() {
24 gui.update(&mut rl);
25 let mut d = rl.begin_drawing(&thread);
26
27 d.clear_background(Color::WHITE);
28 d.draw_text("Hello, world!", 12, 12, 20, Color::BLACK);
29 d.on_ui(&mut gui, &mut open);
30 }
31}
More examples
examples/demo_window.rs (line 10)
4fn main() {
5 let (mut rl, thread) = raylib::init()
6 .size(800, 600)
7 .title("Demo window")
8 .build();
9
10 let mut gui = RaylibGui::new(&mut rl, &thread);
11 let mut open = true;
12
13 while !rl.window_should_close() {
14 let ui = gui.begin(&mut rl);
15 ui.show_demo_window(&mut open);
16 // Draw ImGui stuff here
17
18 let mut d = rl.begin_drawing(&thread);
19 d.clear_background(Color::WHITE);
20 // Draw raylib stuff here
21
22 gui.end();
23 }
24}
pub fn set_style(&mut self, style: Style)
Sourcepub fn update(&mut self, rl: &mut RaylibHandle)
pub fn update(&mut self, rl: &mut RaylibHandle)
Examples found in repository?
examples/raylib_draw_extension.rs (line 24)
14fn main() {
15 let (mut rl, thread) = raylib::init()
16 .size(800, 600)
17 .title("Using raylib draw")
18 .build();
19
20 let mut gui = RaylibGui::new(&mut rl, &thread);
21 let mut open = true;
22
23 while !rl.window_should_close() {
24 gui.update(&mut rl);
25 let mut d = rl.begin_drawing(&thread);
26
27 d.clear_background(Color::WHITE);
28 d.draw_text("Hello, world!", 12, 12, 20, Color::BLACK);
29 d.on_ui(&mut gui, &mut open);
30 }
31}
pub fn update_delta(&mut self, rl: &mut RaylibHandle, delta_time: f32)
Sourcepub fn begin(&mut self, rl: &mut RaylibHandle) -> &mut Ui
pub fn begin(&mut self, rl: &mut RaylibHandle) -> &mut Ui
Examples found in repository?
examples/demo_window.rs (line 14)
4fn main() {
5 let (mut rl, thread) = raylib::init()
6 .size(800, 600)
7 .title("Demo window")
8 .build();
9
10 let mut gui = RaylibGui::new(&mut rl, &thread);
11 let mut open = true;
12
13 while !rl.window_should_close() {
14 let ui = gui.begin(&mut rl);
15 ui.show_demo_window(&mut open);
16 // Draw ImGui stuff here
17
18 let mut d = rl.begin_drawing(&thread);
19 d.clear_background(Color::WHITE);
20 // Draw raylib stuff here
21
22 gui.end();
23 }
24}
pub fn begin_delta(&mut self, rl: &mut RaylibHandle, delta_time: f32) -> &mut Ui
Sourcepub fn end(&mut self)
pub fn end(&mut self)
Examples found in repository?
examples/demo_window.rs (line 22)
4fn main() {
5 let (mut rl, thread) = raylib::init()
6 .size(800, 600)
7 .title("Demo window")
8 .build();
9
10 let mut gui = RaylibGui::new(&mut rl, &thread);
11 let mut open = true;
12
13 while !rl.window_should_close() {
14 let ui = gui.begin(&mut rl);
15 ui.show_demo_window(&mut open);
16 // Draw ImGui stuff here
17
18 let mut d = rl.begin_drawing(&thread);
19 d.clear_background(Color::WHITE);
20 // Draw raylib stuff here
21
22 gui.end();
23 }
24}
pub fn reload_fonts(&mut self)
pub fn prepare_frame(&mut self, rl: &mut RaylibHandle, delta_time: f32)
pub fn handle_events(&mut self, rl: &mut RaylibHandle)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RaylibGui
impl !RefUnwindSafe for RaylibGui
impl !Send for RaylibGui
impl !Sync for RaylibGui
impl Unpin for RaylibGui
impl !UnwindSafe for RaylibGui
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