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

add a rough implement of get_mouse_pos on Windows #5

Closed
wants to merge 3 commits into from

Conversation

chaosddp
Copy link
Collaborator

@chaosddp chaosddp commented May 4, 2017

a rough way to get mouse position, so that we can use this for custom cursor.

There is a precision issue, as the Windows api GetWindowRect returns the positions in pixels, we need a better way to improve this.
And I'm not sure about the performance to call win32 api per frame.

@AGulev
Copy link
Collaborator

AGulev commented May 4, 2017

Hmmm... As I understand it can be implemented with defold functionality, no?
https://forum.defold.com/t/big-list-of-feature-requests-based-on-our-experience-on-ludum-dare/2789/7?u=agulev

@chaosddp
Copy link
Collaborator Author

chaosddp commented May 4, 2017

@AGulev you are right, i did not notice that, i will close it

@chaosddp chaosddp closed this May 4, 2017
@subsoap
Copy link
Owner

subsoap commented May 5, 2017

We actually do need system get_mouse_pos because we need to be able to detect if the mouse cursor is hovering over the title bar on Windows and if the mouse cursor is disabled then temporarily enable it because otherwise it will remain invisible which is bad for user usability because custom graphic cursors can't be drawn above Window title. Defold ignores input directly outside of its viewport, and doesn't report action/mouse positions in the titlebar. It would also be useful to be able to detect when the mouse is actually outside of the game window, such as accurately updating graphical custom cursor images, because otherwise they would only update when the actual pointer is within the game viewport.

@chaosddp
Copy link
Collaborator Author

chaosddp commented May 6, 2017

merged, it just return the position on screen now

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

Successfully merging this pull request may close these issues.

3 participants