Learn Create Your Own Split Screen

Next Page

We learned early in S2JS that the HTML canvas has x=0, y=0 at the top left corner. So you'd expect the mouse (or finger) to report x=0, y=0 when it's in the top left of the canvas. But it's clearly not.

As it happens, the coordinates we receive in the events are relative to the top-left of our simulated browser window, not the canvas.

In the example below, I haven't constrained the events to the canvas -- we'll get events for the entire window.

Roam your mouse or finger around the simulated screen and get an understanding of where the (0,0) point is.