Skip to main content

Inverse Rotate Coordinates (screen.unrotate_xy)

Declaration

ux, uy = screen.unrotate_xy(x, y)

Parameters

  • x, y
    Integer. Coordinates in the rotated coordinate system.

Returns

  • ux, uy
    Integer. Coordinates converted back to the original (unrotated) coordinate system.

Description

Convert a point from the rotated coordinate system back to the original coordinate system, according to the rotation set by screen.init.

Example

-- Suppose screen.init has set a 90-degree rotation
local ux, uy = screen.unrotate_xy(100, 200)
-- Use ux, uy when you need to operate in the original coordinate system