mini_arcade_core.spaces.geometry.bounds ======================================= .. py:module:: mini_arcade_core.spaces.geometry.bounds .. autoapi-nested-parse:: 2D geometry data structures. Classes ------- .. autoapisummary:: mini_arcade_core.spaces.geometry.bounds.Position2D mini_arcade_core.spaces.geometry.bounds.Size2D mini_arcade_core.spaces.geometry.bounds.Bounds2D Module Contents --------------- .. py:class:: Position2D Simple 2D position. :ivar x (float): X coordinate. :ivar y (float): Y coordinate. .. py:attribute:: x :type: float .. py:attribute:: y :type: float .. py:method:: to_tuple() -> tuple[float, float] Convert Position2D to a tuple. :return: Tuple of (x, y). :rtype: tuple[float, float] .. py:class:: Size2D Simple 2D size. :ivar width (int): Width. :ivar height (int): Height. .. py:attribute:: width :type: int .. py:attribute:: height :type: int .. py:method:: to_tuple() -> tuple[int, int] Convert Size2D to a tuple. :return: Tuple of (width, height). :rtype: tuple[int, int] .. py:class:: Bounds2D Axis-aligned rectangular bounds in world space. (left, top) .. (right, bottom) :ivar left (float): Left boundary. :ivar top (float): Top boundary. :ivar right (float): Right boundary. :ivar bottom (float): Bottom boundary. .. py:attribute:: left :type: float .. py:attribute:: top :type: float .. py:attribute:: right :type: float .. py:attribute:: bottom :type: float .. py:method:: from_size(size: Size2D) -> Bounds2D :classmethod: Convenience factory for screen/world bounds starting at (0, 0). :param size: Size2D defining the bounds. :type size: Size2D :return: Bounds2D from (0,0) to (size.width, size.height). :rtype: Bounds2D