Skip to content

Pointer Locked Game with a Virtual Pointer #5810

@jedateach

Description

@jedateach

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions