Open Arhowk opened 7 years ago
I don't see any reason to have any of those. Instead enabling API for cursor locking (like what all FPS games use). Would solve most of the requests.
What I also expected to see in this issue but didn't is controlling the cursor visuals. Currently if you were to implement, say, custom targeting or maybe clicking on NPCs in an RPG there would be no possibility to add visual feedback on the cursor.
I don't see any reason to have any of those. Instead enabling API for cursor locking (like what all FPS games use). Would solve most of the requests.
From a technical perspective, I feel like adding cursor locking is just wrapping the above functions in a different API (It's essentially calling SetCursorVisible(false) than SetCursorPosition(0,0) every 0.03 seconds.) The issue I see with this implementation is that delta X/Y has to be handled somehow; if GetDeltaX/Y functions return the delta of the previous 0.03 seconds than it would be susceptible to lag; otherwise it would be more awkward to implement than just allowing the user to do it through SetCursorPosition. It also seems kind of counter productive to wrap the API internally for no good reason whatsoever than lock out other potential that a raw API could provide.
(for reference I only wanted the SetCursorVisible function but decided to include the SetCursorPosition for fullness)
What I also expected to see in this issue but didn't is controlling the cursor visuals. Currently if you were to implement, say, custom targeting or maybe clicking on NPCs in an RPG there would be no possibility to add visual feedback on the cursor.
From what I can gather on this, you want a way to modify the cursor STATE (e.g. "default" pointer, insert text (the capital I lookin thing), click button (the open hand looking cursor), as well as apply a render color (red for bad target, green for good, etc). I think both are good additions.
cursor
property) (implementing the csscursor
property would also be appreciated)