pub struct DrawImage {
pub rect: Rect,
pub icon: IconId,
pub tint: Color,
pub rotation_rad: f32,
}Expand description
Icon or image draw primitive.
Rotation is in radians around the renderer-defined image center. Values are stored verbatim and tint uses linear RGBA.
§Examples
use ailloli_ui_core::{Color, IconId, Rect};
use ailloli_ui_runtime::scene::DrawImage;
let image = DrawImage {
rect: Rect::new(0.0, 0.0, 16.0, 16.0), icon: IconId::Check,
tint: Color::WHITE, rotation_rad: 0.0,
};
assert_eq!(image.rotation_rad, 0.0);Fields§
§rect: RectDestination rectangle in window-space logical pixels.
icon: IconIdProvider-neutral image/icon identifier.
tint: ColorLinear-RGBA multiplicative tint.
rotation_rad: f32Clockwise rotation in radians; zero means unrotated.
Trait Implementations§
impl StructuralPartialEq for DrawImage
Auto Trait Implementations§
impl Freeze for DrawImage
impl RefUnwindSafe for DrawImage
impl Send for DrawImage
impl Sync for DrawImage
impl Unpin for DrawImage
impl UnwindSafe for DrawImage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.