Pointer Locked Game with a Virtual Pointer #5901
jedateach
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Pointer locking is necessary for an FPS style game so that the cursor is hidden, and doesn't leave the game screen.
But it's not just useful for FPS games, there are other reasons to lock off the cursor. In my use case, I have a full-screen Kiosk-style app for which I want to prevent the cursor being used for purposes other than within my app.
For now, I'm just making use of the regular pointer, and in some cases displaying a custom pointer. However, the pointer can still escape into the operating system dock, external displays, or various UI elements that might display on screen.
A cursor can be simulated by updating an object's position using the position deltas.
What quickly became apparent was that Phaser's object interactivity wouldn't work because the hitbox checking checks using regular (non-locked) pointers.
I was hoping I could introduce a sort of Proxy/Virtual pointer that acts like a regular pointer. However, it also appears the pointer system is locked away under private APIs, and wouldn't easily be introduced as a plugin.
Is there a way (now or in future) for pointer locked games to use 'virtual' pointers?
Beta Was this translation helpful? Give feedback.
All reactions