Page 1 of 1

Request to add API of getting user's mouse location on surface

Posted: Sat Nov 07, 2020 7:55 am
by seancheey
Hi,

I suggest add a new API is LuaPlayer like this:
```
LuaPlayer.get_cursor_surface_location() -> Position
```
Or:

add a new surface_position parameter to user's custom input event that involves cursor clicking.

This makes a lot of operations possible, such as let player go to x,y location, or put a series of marker on ground base of user's cursor location.

Thanks

Re: Request to add API of getting user's mouse location on surface

Posted: Wed Nov 11, 2020 9:35 pm
by NotRexButCaesar
+1

Re: Request to add API of getting user's mouse location on surface

Posted: Mon Nov 16, 2020 11:39 pm
by Rseding91
Ok, I added "cursor_position" to all custom-input events.

Re: Request to add API of getting user's mouse location on surface

Posted: Tue Nov 17, 2020 3:05 am
by NotRexButCaesar
You guys are the best!

Re: Request to add API of getting user's mouse location on surface

Posted: Tue Nov 17, 2020 3:08 am
by raiguard
This is amazing, and thank you!

While this will work for a huge variety of usecases, it won't work for my specific usecase: dragging. I'll still have to resort to using capsules (which don't work on the map view) in order to facilitate this.

The only way to suit my usecase would be to have an option to repeatedly fire the custom input if it is held down, so I can read changes in the position. So, I don't expect it to be possible, but may as well ask! Thank you again.