pub struct WindowWrapper<UserEventType> { /* private fields */ }
Expand description

Wraps an egui context with features that are useful for integrating egui with Speedy2d.

Implementations§

Creates a new WindowWrapper and underlying egui context.

Draws the latest finished GUI frame to the screen.

Trait Implementations§

Invoked once when the window first starts.

Invoked when a user-defined event is received, allowing you to wake up the event loop to handle events from other threads.

See WindowHelper::create_user_event_sender.

Invoked when the window is resized.

Invoked if the mouse cursor becomes grabbed or un-grabbed. See WindowHelper::set_cursor_grab.

Note: mouse movement events will behave differently depending on the current cursor grabbing status.

Invoked if the window enters or exits fullscreen mode. See WindowHelper::set_fullscreen_mode.

Invoked when the window scale factor changes.

Invoked when the contents of the window needs to be redrawn.

It is possible to request a redraw from any callback using WindowHelper::request_redraw.

Invoked when the mouse changes position.

Normally, this provides the absolute position of the mouse in the window/canvas. However, if the mouse cursor is grabbed, this will instead provide the amount of relative movement since the last move event.

See WindowHandler::on_mouse_grab_status_changed.

Invoked when a mouse button is pressed.

Invoked when a mouse button is released.

Invoked when the mouse wheel moves.

Invoked when a keyboard key is pressed.

To detect when a character is typed, see the WindowHandler::on_keyboard_char callback.

Invoked when a keyboard key is released.

Invoked when a character is typed on the keyboard.

This is invoked in addition to the WindowHandler::on_key_up and WindowHandler::on_key_down callbacks.

Invoked when the state of the modifier keys has changed.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.