pub struct Shape { /* private fields */ }Implementations§
Source§impl Shape
impl Shape
pub fn new(shape_type: ShapeType) -> Self
pub fn set_fill_color(&mut self, color: Color)
pub fn set_border_color(&mut self, color: Color)
pub fn set_border_width(&mut self, width: f32)
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 Shape
impl Widget for Shape
fn draw(&self, renderer: &mut Renderer, _screen_width: f32, _screen_height: f32)
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 set_position(&mut self, x: f32, y: f32)
fn set_size(&mut self, width: f32, height: f32)
fn position(&self) -> (f32, f32)
fn size(&self) -> (f32, f32)
fn set_position_animation(&mut self, animation: Vec2Animation)
fn set_fade_animation(&mut self, animation: FadeAnimation)
fn set_on_click<F>(&mut self, callback: F)where
F: FnMut() + 'static,
fn set_on_hover<F>(&mut self, callback: F)
fn on_mouse_press(&mut self, x: f32, y: f32) -> bool
fn on_mouse_release(&mut self, x: f32, y: f32) -> bool
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 Freeze for Shape
impl !RefUnwindSafe for Shape
impl !Send for Shape
impl !Sync for Shape
impl Unpin for Shape
impl UnsafeUnpin for Shape
impl !UnwindSafe for Shape
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> 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
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.