psychos.visual.units.PercentageUnit#
- class psychos.visual.units.PercentageUnit(window: Window)[source]#
Bases:
UnitPercentage unit system.
100% width corresponds to the full width of the window.
100% height corresponds to the full height of the window.
Methods
__init__(window)from_name(name, window)Instantiate a unit system class by name or return the instance if already provided.
inverse_transform(x, y)Convert coordinates from pixel values to units.
inverse_transform_size(width, height)Convert size from pixel values to units.
transform(x, y)Convert coordinates from units to pixel values.
transform_size(width, height)Convert size from units to pixel values.
- inverse_transform(x: int, y: int) Tuple[float, float][source]#
Convert coordinates from pixel values to units.
- inverse_transform_size(width: int, height: int) Tuple[float, float][source]#
Convert size from pixel values to units.