pub struct RotationPlugin { /* private fields */ }Expand description
A egui::Plugin that applies per-viewport rotation transparently.
One instance per egui::Context. Change the root rotation at runtime through
the registered handle:
ctx.plugin::<RotationPlugin>().lock().set_rotation(Rotation::CW270);Implementations§
Source§impl RotationPlugin
impl RotationPlugin
Sourcepub fn new(rotation: Rotation) -> Self
pub fn new(rotation: Rotation) -> Self
Create a plugin rotating the root viewport by rotation.
Child viewports are left untouched unless configured with
Self::set_viewport_rotation.
Sourcepub fn set_rotation(&mut self, rotation: Rotation)
pub fn set_rotation(&mut self, rotation: Rotation)
Set the root viewport’s rotation. Takes effect on the next frame.
Sourcepub fn viewport_rotation(&self, viewport: ViewportId) -> Rotation
pub fn viewport_rotation(&self, viewport: ViewportId) -> Rotation
The rotation configured for a specific viewport (None if unconfigured).
Sourcepub fn set_viewport_rotation(
&mut self,
viewport: ViewportId,
rotation: Rotation,
)
pub fn set_viewport_rotation( &mut self, viewport: ViewportId, rotation: Rotation, )
Set the rotation for a specific viewport (e.g. a child window). Pass
Rotation::None to stop rotating it.
Trait Implementations§
Source§impl Clone for RotationPlugin
impl Clone for RotationPlugin
Source§fn clone(&self) -> RotationPlugin
fn clone(&self) -> RotationPlugin
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RotationPlugin
impl Debug for RotationPlugin
Source§impl Default for RotationPlugin
impl Default for RotationPlugin
Source§fn default() -> RotationPlugin
fn default() -> RotationPlugin
Returns the “default value” for a type. Read more
Source§impl Plugin for RotationPlugin
impl Plugin for RotationPlugin
Source§fn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
Plugin name. Read more
Source§fn input_hook(&mut self, input: &mut RawInput)
fn input_hook(&mut self, input: &mut RawInput)
Called just before the input is processed. Read more
Source§fn output_hook(&mut self, output: &mut FullOutput)
fn output_hook(&mut self, output: &mut FullOutput)
Called just before the output is passed to the backend. Read more
Source§fn on_begin_pass(&mut self, ui: &mut Ui)
fn on_begin_pass(&mut self, ui: &mut Ui)
Called at the start of each pass. Read more
Source§fn on_end_pass(&mut self, ui: &mut Ui)
fn on_end_pass(&mut self, ui: &mut Ui)
Called at the end of each pass. Read more
Source§fn on_widget_under_pointer(&mut self, ctx: &Context, widget: &WidgetRect)
fn on_widget_under_pointer(&mut self, ctx: &Context, widget: &WidgetRect)
Called when a widget is created and is under the pointer. Read more
Auto Trait Implementations§
impl Freeze for RotationPlugin
impl RefUnwindSafe for RotationPlugin
impl Send for RotationPlugin
impl Sync for RotationPlugin
impl Unpin for RotationPlugin
impl UnsafeUnpin for RotationPlugin
impl UnwindSafe for RotationPlugin
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