Skip to content

Commit

Permalink
clientMain: fix mouse input
Browse files Browse the repository at this point in the history
After adding a second canvas, we need to detect mouse events against
the entire document body, rather than the 3d canvas.
  • Loading branch information
jeffomatic committed Dec 21, 2020
1 parent 657259c commit 6de5148
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/clientMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const client = new Client({ canvas3d, canvas2d })

// Set up local input
client.keyboard = new Keyboard()
client.mouse = new Mouse(canvas3d)
client.mouse = new Mouse(document.body)

// Development-related globals
window.client = client // expose game to console
Expand Down

0 comments on commit 6de5148

Please sign in to comment.