Enum sark_grids::pivot::Pivot
source · pub enum Pivot {
TopLeft,
TopRight,
Center,
BottomLeft,
BottomRight,
}
Expand description
A pivot point on a 2d rect.
Variants§
TopLeft
+X Right, +Y Down.
TopRight
+X Left, +Y Down.
Center
+X Right, +Y Up.
BottomLeft
+X Right, +Y Up.
BottomRight
+X Left, +Y Up
Implementations§
source§impl Pivot
impl Pivot
sourcepub fn axis(&self) -> IVec2
pub fn axis(&self) -> IVec2
Coordinate axis for each pivot, used when transforming a point into the pivot’s coordinate space
sourcepub fn transform_point(
&self,
point: impl GridPoint,
size: impl GridPoint
) -> IVec2
pub fn transform_point( &self, point: impl GridPoint, size: impl GridPoint ) -> IVec2
Transform a point to it’s equivalent position from the perspective of this pivot
Trait Implementations§
source§impl PartialEq for Pivot
impl PartialEq for Pivot
impl Copy for Pivot
impl Eq for Pivot
impl StructuralPartialEq for Pivot
Auto Trait Implementations§
impl Freeze for Pivot
impl RefUnwindSafe for Pivot
impl Send for Pivot
impl Sync for Pivot
impl Unpin for Pivot
impl UnwindSafe for Pivot
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