pub struct ImageButton<'a> { /* private fields */ }๐Deprecated since 0.33.0: Use egui::Button::image instead
Expand description
A clickable image within a frame.
Implementationsยง
Sourceยงimpl<'a> ImageButton<'a>
impl<'a> ImageButton<'a>
pub fn new(image: impl Into<Image<'a>>) -> Self
Sourcepub fn uv(self, uv: impl Into<Rect>) -> Self
pub fn uv(self, uv: impl Into<Rect>) -> Self
Select UV range. Default is (0,0) in top-left, (1,1) bottom right.
Sourcepub fn tint(self, tint: impl Into<Color32>) -> Self
pub fn tint(self, tint: impl Into<Color32>) -> Self
Multiply image color with this. Default is WHITE (no tint).
Sourcepub fn sense(self, sense: Sense) -> Self
pub fn sense(self, sense: Sense) -> Self
By default, buttons senses clicks.
Change this to a drag-button with Sense::drag().
Sourcepub fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
pub fn corner_radius(self, corner_radius: impl Into<CornerRadius>) -> Self
Set rounding for the ImageButton.
If the underlying image already has rounding, this will override that value.
Sourcepub fn rounding(self, corner_radius: impl Into<CornerRadius>) -> Self
๐Deprecated: Renamed to corner_radius
pub fn rounding(self, corner_radius: impl Into<CornerRadius>) -> Self
corner_radiusSet rounding for the ImageButton.
If the underlying image already has rounding, this will override that value.
Trait Implementationsยง
Sourceยงimpl<'a> Clone for ImageButton<'a>
impl<'a> Clone for ImageButton<'a>
Sourceยงfn clone(&self) -> ImageButton<'a>
fn clone(&self) -> ImageButton<'a>
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSourceยงimpl<'a> Debug for ImageButton<'a>
impl<'a> Debug for ImageButton<'a>
Auto Trait Implementationsยง
impl<'a> Freeze for ImageButton<'a>
impl<'a> RefUnwindSafe for ImageButton<'a>
impl<'a> Send for ImageButton<'a>
impl<'a> Sync for ImageButton<'a>
impl<'a> Unpin for ImageButton<'a>
impl<'a> UnwindSafe for ImageButton<'a>
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