pub struct ImageView { /* private fields */ }Implementations§
Source§impl ImageView
impl ImageView
pub fn new() -> Self
pub fn load_from_path<P: AsRef<Path>>(&mut self, path: P) -> Result<(), String>
pub fn load_from_url(&mut self, url: &str) -> Result<(), String>
pub fn update_hover(&mut self, x: f32, y: f32)
pub fn has_fade_animation(&self) -> bool
pub fn has_position_animation(&self) -> bool
Trait Implementations§
Source§impl Widget for ImageView
impl Widget for ImageView
fn get_position(&self) -> (f32, f32)
fn get_size(&self) -> (f32, f32)
fn get_background_color(&self) -> Color
fn get_text_color(&self) -> Color
fn get_hover_background_color(&self) -> Color
fn get_hover_text_color(&self) -> Color
fn get_opacity(&self) -> f32
fn get_is_hovered(&self) -> bool
fn get_is_pressed(&self) -> bool
fn draw(&self, renderer: &mut Renderer, _screen_width: f32, _screen_height: f32)
fn set_size(&mut self, width: f32, height: f32)
fn position(&self) -> (f32, f32)
fn size(&self) -> (f32, f32)
fn set_position(&mut self, x: f32, y: f32)
fn on_mouse_press(&mut self, x: f32, y: f32) -> bool
fn on_mouse_release(&mut self, x: f32, y: f32) -> bool
fn set_on_click<F>(&mut self, callback: F)where
F: FnMut() + 'static,
fn set_on_hover<F>(&mut self, callback: F)
fn set_position_animation(&mut self, animation: Vec2Animation)
fn set_fade_animation(&mut self, animation: FadeAnimation)
fn update_animations(&mut self, delta_time: f32)
fn contains_point(&self, x: f32, y: f32) -> bool
fn animate_position(&mut self, target_x: f32, target_y: f32, duration: f32)
fn animate_fade(&mut self, start: f32, end: f32, duration: f32)
fn resize_by_window_size(&mut self, scale_x: f32, scale_y: f32)
Auto Trait Implementations§
impl !RefUnwindSafe for ImageView
impl !Send for ImageView
impl !Sync for ImageView
impl !UnwindSafe for ImageView
impl Freeze for ImageView
impl Unpin for ImageView
impl UnsafeUnpin for ImageView
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.