Expand description
§egui-rotate
Viewport rotation (0° / 90° / 180° / 270°) for egui.
Use cases: virtual pinball cabinets, kiosks, embedded displays, industrial panels — any setup where the physical screen is mounted rotated and the OS cannot (or should not) rotate the whole desktop.
This crate does not modify egui: it ships RotationPlugin, a
self-contained egui::Plugin. Register it once and rotation becomes
transparent for input, rendering and the OS cursor — on any backend
(egui_glow, egui_wgpu, eframe, custom), with no other integration code.
§Quick start
use egui_rotate::{Rotation, RotationPlugin};
ctx.add_plugin(RotationPlugin::new(Rotation::CW90));That’s it: pointer/touch input is remapped into the rotated space, the whole UI is rendered rotated, and directional OS cursor icons are remapped.
§Multiple windows
Rotation is per-viewport and opt-in. RotationPlugin::new configures the
root window; child windows pass through untouched unless you configure them
with RotationPlugin::set_viewport_rotation. So a rotated cabinet window can
coexist with upright settings dialogs.
§Software cursor (feature software-cursor, opt-in)
Enable with egui-rotate = { version = "…", features = ["software-cursor"] }.
See [SoftwareCursor] for the rotated virtual cursor used by pinball cabinets
and kiosks where the OS cursor cannot be rotated; attach it with
[RotationPlugin::with_software_cursor].
§Custom integration (without the plugin)
If you cannot use the plugin, the building blocks are public: Rotation’s
transform methods for input, and rotate_clipped_shapes / rotate_shape
to rotate pre-tessellation shapes. The older manual helpers
transform_raw_input and transform_clipped_primitives are deprecated
since 1.0 — prefer the plugin.
Structs§
- Rotation
Plugin - A
egui::Pluginthat applies per-viewport rotation transparently.
Enums§
- Rotation
- Viewport rotation in 90-degree increments (clockwise).
Traits§
- Cursor
Icon Ext - Extension trait for
CursorIconadding rotation-aware remapping.
Functions§
- rotate_
clipped_ shapes - Rotate pre-tessellation
ClippedShapes from logical UI space back to physical screen space, in place. - rotate_
shape - Rotate a single
Shapefrom logical UI space back to physical screen space, in place. - transform_
clipped_ primitives Deprecated - Transform tessellated primitives from logical UI space back to physical screen space.
- transform_
raw_ input Deprecated - Transform a
RawInputfrom physical screen space to logical UI space.