So I have this partially working, but I can't get it to appear in the right place. Basically I'm letting the user draw a square/rectangle by dragging.
This is in the ended phase of the drag event:
recWidth = math.abs(event.x - event.xStart)
recHeight = math.abs(event.x - event.xStart)
local myRectangle = display.newRect(event.xStart, event.yStart, recWidth, recHeight)
and it works in that it does actually render a rectangle. But, it seems to be mostly wrong. I'm sure there is some mathematical equation for this, but I barely graduated from high school and it's making my brain hurt.
You'll see in the drawing here where the rectangle should appear:
https://img.skitch.com/20110813-m257gr8qef2n5y93m4gentsxcy.jpg
Any help is GREATLY appreciated.
Thanks!
scott.