Skip to main content
Module

x/oid/mod.ts>Viewport.toLevelXY

oidoid 2D game engine.
Go to Latest
function Viewport.toLevelXY
import { Viewport } from "https://deno.land/x/oid@v0.0.7/mod.ts";
const { toLevelXY } = Viewport;

Parameters

point: Readonly<NumXY>

The viewport coordinates of the input in window pixels, usually new XY(event.clientX, event.clientY).

clientViewportWH: Readonly<NumXY>

The coordinates and dimensions of the camera the input was made through in level pixels.

cam: Readonly<I16Box>

Returns

The fractional position in level coordinates.