Page 1 of 1

Make on_gui_click event return x/y offset inside the clicked element

Posted: Thu Jul 11, 2019 12:39 pm
by Godmave
Use case:
- show a minimap/camera and allow the player to click it, deducing what the player wanted to click on our own.
- allow an interactive clusterio node map that is clickable to get more info on nodes and/or connect to them.

Re: Make on_gui_click event return x/y offset inside the clicked element

Posted: Thu Jul 11, 2019 12:44 pm
by psihius
At minimum we just want an X,Y coordinate of the click on the map. We can go from there with math :)

Re: Make on_gui_click event return x/y offset inside the clicked element

Posted: Thu Jul 11, 2019 4:10 pm
by Boodals
I can't see x, y data being sent for all gui mouse clicks, as 99% of the time it would be unnecessary, but a special case for cameras might be okay. It should be in world coordinates though, not mouse position, as that would be much more useful. I also want a camera dragged event, so we can make cameras draggable like the map GUI, or it could be implemented as a flag on the camera and have it handled by the game.