tesselode Profile picture
gamedev and music | low stress tweets | avatar by @sjmpson11
Aug 26, 2021 4 tweets 3 min read
A subtle tip for people integrating #egui with a game engine:

egui provides wants_pointer_input(), which tells you if the mouse is over a UI element. If so, the rest of the game should not receive mouse input. Same with wants_keyboard_input().

(1/4)

#rustlang #gamedev egui doesn't know if it wants input until *after* you call end_frame(). So you should run your UI code at the beginning of the game loop, before the rest of your game receives events or does updates.

(2/4)

#rustlang #gamedev