bevyengine / bevyengine/bevy

Expose a `CursorPosition` resource

Open
#5,034 10 comments 0 reactions 0 assignees View on GitHub
A-Input C-Usability
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

Knowing where your mouse is is useful and should be ergonomic.

## What solution would you like?

Store and update a `CursorPosition` resource, which reads from the `Window` resource to store an `Option` representing the physical position of the mouse (or other cursor).

## What alternative(s) have you considered?

Compute this manually every time it's needed.

## Additional context

This will be impacted by #4530, which will move where this data is stored.

Better APIs to convert between world space and screen space coordinates will make this functionality even more useful; we should add methods on `MousePosition` to do this once those are established.

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the Window resource and the location where cursor position data is currently stored, then read issue #4530 because it changes that storage. Implement the CursorPosition resource as an Option updated from Window data, and verify that consumers can access the physical mouse or cursor position without recomputing it manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.