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