SourceEnum Align
from egui import AlignAlign.BOTTOM
Align.Center
Align.LEFT
Align.Max
Align.Min
Align.RIGHT
Align.TOPleft/center/right or top/center/bottom alignment for e.g. anchors and layouts.
Variants§
Align.BOTTOM Enum value§
Align.Center Enum value§
Align.LEFT Enum value§
Align.Max Enum value§
Align.Min Enum value§
Align.RIGHT Enum value§
Align.TOP Enum value§
Methods§
Sourcedef align_size_within_range(self, /, size: float, min: float, max: float) -> tuple[float, float]§
Returns a range of given size within a specified range.
If the requested size is bigger than the size of range, then the returned
range will not fit into the available range. The extra space will be allocated
from:
| Align | Side |
|---|---|
| Min | right (end) |
| Center | both |
| Max | left (start) |
Examples
The infinity-sized ranges can produce a surprising results, if the size is also infinity, use such ranges with carefully!
Sourcedef flip(self, /) -> Align§
Returns the inverse alignment.
Min becomes Max, Center stays the same, Max becomes Min.
Sourcedef to_factor(self, /) -> float§
Convert Min => 0.0, Center => 0.5 or Max => 1.0.
Sourcedef to_sign(self, /) -> float§
Convert Min => -1.0, Center => 0.0 or Max => 1.0.