Skip to content

ebiten: add API to get better fidelity mouse cursor position #3394

@SolarLune

Description

@SolarLune

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

What feature would you like to be added?

At small game layout sizes, having the mouse cursor position be locked to the layout size and returned as int is a bit restrictive. This is, in my case, particularly kind of a problem when used for mouse look for rotating the camera with Tetra3D with a small fixed game layout size, since smaller resolutions give less room for the mouse cursor to work with in terms of detecting movement from frame to frame.

There's a few possible solutions to help with this.

  1. Is it possible to add a function to enable raw mouse motion where possible and another to disable the cursor?
  2. Or, is it possible to get the absolute mouse cursor position in the window / fullscreen game, rather than the mouse cursor location in the game's layout? That way cursor fidelity grows with window / monitor size, rather than staying static at low resolutions.
  3. Would probably also be good to return cursor positions as a float32 / float64 for subpixel accuracy on the platforms that support it, as some platforms currently do? Currently, ebiten.CursorPosition() returns the cursor's location as ints, constrained to the game's layout size.

Why is this needed?

Would give you more fidelity for mouse look, and more accuracy and options for mouse positioning.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions