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

get_mouse_position() not working #32

Closed
OkiStuff opened this issue Mar 28, 2020 · 2 comments
Closed

get_mouse_position() not working #32

OkiStuff opened this issue Mar 28, 2020 · 2 comments

Comments

@OkiStuff
Copy link

So I'm trying to create a simple world editor using Ursina Engine, but when I looked on the documentation I couldn't find anything that would help me with the mouse position. I did already tried doing mouse.position, but the output wasn't an integer. And when I tried get_mouse_position() it wasn't there. So by any chance would you help me by either telling me if my code is wrong, or maybe showing me where in your code you have the Cursor() function or any other function that uses the position of the mouse. Thanks love your engine. if held_keys['left mouse down']: player.x = mouse.position

@pokepetter
Copy link
Owner

mouse.position returns position in ui space, see https://www.ursinaengine.org/coordinate_system.html

@pokepetter
Copy link
Owner

Now that I read this again, what I think you want is: player.x = mouse.x

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