Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cursor disable and mouse delta values #360

Open
akiriwas opened this issue Jan 24, 2024 · 1 comment
Open

cursor disable and mouse delta values #360

akiriwas opened this issue Jan 24, 2024 · 1 comment

Comments

@akiriwas
Copy link

I've been working my way through the PGE code and found two things I am pretty sure aren't possible but I wanted to ask. The first is to disable the cursor, if for instance you want to write a game where the mouse controls an "in game" cursor with a separate graphic. The second is getting mouse delta values rather than position values. In this case, if we combined the two and disabled the cursor and get relative movement values, we could implement an aiming system or something similar.

I've seen both of these in other (far more complex) engines, but wanted to confirm this wasn't possible in PGE (or wasn't possible with some minor changes?) Thanks!

@Moros1138
Copy link
Collaborator

I can confirm it is not possible to do either of these things with stock/official PGE.

Speaking strictly about cursor. I made modifications to PGE nearly 2 years ago that added ShowSystemCursor(bool) to the PGE API, and implemented them in all of the platforms PGE supported, at the time.

It's located here:
https://github.com/Moros1138/PGECursor

example usage can be found in src/main.cpp

DISCLAIMER: I want to be absolutely clear. The repository I linked is a MODIFIED, OLD VERSION of PGE. A lot can happen in 2 years and some features will no doubt be missing if you try to use it! If you're adventurous, you could use it as reference and modify a more modern version of PGE.

Shifting gears to the relative mouse coordinates.. I just did a quick skim and it looks to me like all of the platform reporting about the mouse movement is done with absolute positions, relative to the window's placement on the screen. I'm sure relative mouse coordinates can be done but I'm not sure how (or if?) it would be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants