pub struct ImageButton<'ui> { /* private fields */ }Expand description
Builder for an image button widget
Implementations§
Source§impl<'ui> ImageButton<'ui>
impl<'ui> ImageButton<'ui>
Sourcepub fn new(
ui: &'ui Ui,
str_id: impl AsRef<str>,
texture: impl Into<TextureRef>,
size: [f32; 2],
) -> Self
pub fn new( ui: &'ui Ui, str_id: impl AsRef<str>, texture: impl Into<TextureRef>, size: [f32; 2], ) -> Self
Creates a new image button builder
Sourcepub fn uv0(self, uv0: [f32; 2]) -> Self
pub fn uv0(self, uv0: [f32; 2]) -> Self
Sets the UV coordinates for the top-left corner (default: [0.0, 0.0])
Sourcepub fn uv1(self, uv1: [f32; 2]) -> Self
pub fn uv1(self, uv1: [f32; 2]) -> Self
Sets the UV coordinates for the bottom-right corner (default: [1.0, 1.0])
Sourcepub fn bg_color(self, bg_color: [f32; 4]) -> Self
pub fn bg_color(self, bg_color: [f32; 4]) -> Self
Sets the background color (default: transparent)
Sourcepub fn tint_color(self, tint_color: [f32; 4]) -> Self
pub fn tint_color(self, tint_color: [f32; 4]) -> Self
Sets the tint color (default: white, no tint)
Trait Implementations§
Auto Trait Implementations§
impl<'ui> Freeze for ImageButton<'ui>
impl<'ui> !RefUnwindSafe for ImageButton<'ui>
impl<'ui> !Send for ImageButton<'ui>
impl<'ui> !Sync for ImageButton<'ui>
impl<'ui> Unpin for ImageButton<'ui>
impl<'ui> !UnwindSafe for ImageButton<'ui>
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