show mouse pixel coordinates in the corona simulator

When making placements of objects, it would be very nice if we could see the pixel coordinates of the mouse, which would make it much quicker to get coordinates correct for setting up display objects.

For example, if I have an app running, and I right clicked on a pixel in the simulator, it would be great if it told me via a hover popup the pixel coordinates of that right click as would be passed to the “touch” event handler.

Then i could setup my objects in just seconds by tapping around the screen and seeing the coordinates, then copying them to my code.

It would be even better if I could drag with the right mouse click and have it tell me the startX,startY, currentX,currentY, widthX,widthY of the rectangle i’m dragging for setting up rectangles/imageboxes.

Maybe you could do this via a “navigator” or “info” window that is optional which just tells you the coordinates of the mouse at all times. [import]uid: 122310 topic_id: 25556 reply_id: 325556[/import]

Well the Corona Level Editor is in Beta now and it probably would do what you want (a WYSIWYG editor).

[import]uid: 19626 topic_id: 25556 reply_id: 103288[/import]

Yep.

I use this with a print statement. I use it to get a general idea of where I want things. You can get fancy and do some … inserting and basically have the print statement save to a file and then use that to copy paste code into.
Here is the most basic of quick and dirty X and Y I use.

--I have a bunch of coins, that I was using to map out  
 local function printXY (event)   
 event.x = event.x  
 event.y = event.y  
 --print (event.x, event.y)  
 print (event.target.myName)  
 end  
--this just puts the X and Y on screen in terminal  
 local function printXYanywhere (event)  
 event.x = event.x  
 event.y = event.y  
 print (event.x, event.y)  
 end  
--event listeners. One on the group, which goes by the name of ----objects  
gameGroup:addEventListener ("tap", printXY)  
  
--This one just allows a tap and prints to terminal  
Runtime:addEventListener ("tap", printXYanywhere)  
  

just something I cooked up to save me time. Just this stupid thing save me hours and hours, rather than guessing, I would be within 80 - 90% of where I was at.

In regards to the Corona SDK level editor, It’s…interesting.

Go try it out yourself, it’s available in alpha (at least it was for me) if it isn’t then, it’s not :slight_smile:

ng [import]uid: 61600 topic_id: 25556 reply_id: 103360[/import]