SourceClass Align2
from egui import Align2class Align2:Two-dimension alignment, e.g. Align2.LEFT_TOP.
Constants§
CENTER_BOTTOM: Final[Align2]§
CENTER_CENTER: Final[Align2]§
CENTER_TOP: Final[Align2]§
LEFT_BOTTOM: Final[Align2]§
LEFT_CENTER: Final[Align2]§
LEFT_TOP: Final[Align2]§
RIGHT_BOTTOM: Final[Align2]§
RIGHT_CENTER: Final[Align2]§
RIGHT_TOP: Final[Align2]§
Methods§
Sourcedef align_size_within_rect(self, /, size: Vec2, frame: Rect) -> Rect§
e.g. center a size within a given frame
Sourcedef anchor_rect(self, /, rect: Rect) -> Rect§
Used e.g. to anchor a piece of text to a part of the rectangle. Give a position within the rect, specified by the aligns
Sourcedef anchor_size(self, /, pos: Pos2, size: Vec2) -> Rect§
Use this anchor to position something around pos,
e.g. egui.Align2.RIGHT_TOP means the right-top of the rect
will end up at pos.
Sourcedef flip(self, /) -> Align2§
Flip on both axes
e.g. TOP_LEFT -> BOTTOM_RIGHT
Sourcedef flip_x(self, /) -> Align2§
Flip on the x-axis
e.g. TOP_LEFT -> TOP_RIGHT
Sourcedef flip_y(self, /) -> Align2§
Flip on the y-axis
e.g. TOP_LEFT -> BOTTOM_LEFT
def name(self, /) -> str§
Sourcedef pos_in_rect(self, /, frame: Rect) -> Pos2§
Returns the point on the rect's frame or in the center of a rect according to the alignments of this object.
Sourcedef to_sign(self, /) -> Vec2§
-1, 0, or +1 for each axis
Sourcedef x(self, /) -> Align§
Returns an alignment by the X (horizontal) axis
Sourcedef y(self, /) -> Align§
Returns an alignment by the Y (vertical) axis