We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I've written simple code to move an ellipse around the screen. I would like include a small function where it asks for a specific coordinate for X and Y from the user if need be. I have done some research on the internet and couldn't find a simple of way of doing it. What I had in my mind was to have a small area in the corner of the screen to input the X and Y coordinate, and also if there was a way of display the current X and Y positions. Thanks
Answers
Another option instead of asking for an user input which requires typing, you could just retrieve the coordinate from the actual mouse position. For example, one could generate a mouse click event, then one would get the current mouse position. This strategy fails if, for example, your sketch has GUI elements (buttons, slide bars, etc) and you need to click there in those sampe positions or in case you have a sketch where your image/background has panning action. An alternative solution is to capture the mouse position by pressing the space bar.
Kf