ModDota / BugTracker

Listing bugs for Dota 2 Custom Games
9 stars 1 forks source link

Implement cursor manipulation functions #104

Open Arhowk opened 7 years ago

Arhowk commented 7 years ago
  1. SetCursorVisible: Sets whether or not the cursor is currently visible (will allow us to do alot of things such as custom targeting / custom cursor textures)
  2. SetCursorPosition: Sets the X/Y position of the cursor
  3. SetCursorState : Sets the current state of the cursor (similar to the css cursor property) (implementing the css cursor property would also be appreciated)
  4. SetCursorRenderColor: abrgb ? (alpha, blend, r,g,b) (for example alpha of 1 and a blend of 0.5 and an RGB of red will tint the cursor 50% red, blend of 1 would make every non-transparent pixel red). I'm not entirely sure on the true implementation of this, feedback would be useful.
DoctorGester commented 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.

Arhowk commented 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.

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.