mini_arcade_core.backend.viewport ================================= .. py:module:: mini_arcade_core.backend.viewport .. autoapi-nested-parse:: Viewport transformation utilities. Classes ------- .. autoapisummary:: mini_arcade_core.backend.viewport.ViewportTransform Module Contents --------------- .. py:class:: ViewportTransform Viewport transformation for coordinate mapping. :ivar ox (int): Origin x-coordinate. :ivar oy (int): Origin y-coordinate. :ivar s (float): Scaling factor. .. py:attribute:: ox :type: int :value: 0 .. py:attribute:: oy :type: int :value: 0 .. py:attribute:: s :type: float :value: 1.0 .. py:method:: map_xy(x: int, y: int) -> tuple[int, int] Map the given (x, y) coordinates using the viewport transformation. :param x: The x-coordinate to map. :type x: int :param y: The y-coordinate to map. :type y: int :return: A tuple containing the mapped (x, y) coordinates. :rtype: tuple[int, int] .. py:method:: map_wh(w: int, h: int) -> tuple[int, int] Map the given width and height using the viewport transformation. :param w: The width to map. :type w: int :param h: The height to map. :type h: int :return: A tuple containing the mapped (width, height). :rtype: tuple[int, int]