SourceClass Pos2
from egui import Pos2class Pos2:A position on screen.
Normally given in points (logical pixels).
Mathematically this is known as a "point", but the term position was chosen so not to conflict with the unit (one point = X physical pixels).
Properties§
@property
def x(self, /) -> float§
@x.setter
def x(self, /, x: float) -> None§
@property
def y(self, /) -> float§
@y.setter
def y(self, /, y: float) -> None§
Methods§
Sourcedef any_nan(self, /) -> bool§
True if any member is NaN.
def at_least(self, /, lower_limit: Pos2) -> Pos2§
def at_most(self, /, upper_limit: Pos2) -> Pos2§
Sourcedef ceil(self, /) -> Pos2§
Sourcedef clamp(self, /, min: Pos2, max: Pos2) -> Pos2§
Sourcedef distance(self, /, other: Pos2) -> float§
Sourcedef distance_sq(self, /, other: Pos2) -> float§
Sourcedef floor(self, /) -> Pos2§
Sourcedef is_finite(self, /) -> bool§
True if all members are also finite.
Sourcedef lerp(self, /, other: Pos2, t: float) -> Pos2§
Linearly interpolate towards another point, so that 0.0 => self, 1.0 => other.
Sourcedef max(self, /, other: Pos2) -> Pos2§
Sourcedef min(self, /, other: Pos2) -> Pos2§
Sourcedef round(self, /) -> Pos2§
Sourcedef to_vec2(self, /) -> Vec2§
The vector from origin to this position.
p.to_vec2() is equivalent to p - Pos2.default().