pub struct Drawable<T: Clone> { /* private fields */ }
Expand description
Represents a shape that is made of points that can be drawn either as a outline or solid
Implementations§
Source§impl<T: Clone> Drawable<T>
impl<T: Clone> Drawable<T>
pub fn with_draw_type(&self, draw_type: DrawType) -> Drawable<T>
Source§impl<T> Drawable<T>
impl<T> Drawable<T>
pub fn with_translation<P: Into<Coord>>(&self, delta: P) -> Drawable<T>
pub fn with_move<P: Into<Coord>>(&self, xy: P) -> Drawable<T>
pub fn with_move_center<P: Into<Coord>>(&self, xy: P) -> Drawable<T>
pub fn with_scale(&self, scale: f32) -> Drawable<T>
pub fn with_scale_around<P: Into<Coord>>( &self, scale: f32, point: P, ) -> Drawable<T>
pub fn with_rotation(&self, degrees: isize) -> Drawable<T>
pub fn with_rotation_around<P: Into<Coord>>( &self, degrees: isize, point: P, ) -> Drawable<T>
pub fn left(&self) -> isize
pub fn right(&self) -> isize
pub fn top(&self) -> isize
pub fn bottom(&self) -> isize
Source§impl<T> Drawable<T>
impl<T> Drawable<T>
pub fn intersects_shape(&self, shape: &dyn Shape) -> Option<bool>
pub fn contains_shape(&self, shape: &dyn Shape) -> Option<bool>
pub fn intersects_drawable<S: Shape + Clone>( &self, drawable: &Drawable<S>, ) -> Option<bool>
pub fn contains_drawable<S: Shape + Clone>( &self, drawable: &Drawable<S>, ) -> Option<bool>
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Drawable<T>where
T: Deserialize<'de> + Clone,
impl<'de, T> Deserialize<'de> for Drawable<T>where
T: Deserialize<'de> + Clone,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq + Clone> Eq for Drawable<T>
impl<T: Clone> StructuralPartialEq for Drawable<T>
Auto Trait Implementations§
impl<T> Freeze for Drawable<T>where
T: Freeze,
impl<T> RefUnwindSafe for Drawable<T>where
T: RefUnwindSafe,
impl<T> Send for Drawable<T>where
T: Send,
impl<T> Sync for Drawable<T>where
T: Sync,
impl<T> Unpin for Drawable<T>where
T: Unpin,
impl<T> UnwindSafe for Drawable<T>where
T: UnwindSafe,
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