This code tries to put both the red and the blue block at x=60. It doesn't. The red block's x is actually 100 according to blahrect.x. Meanwhile, although the blue block says x=60, it looks on screen more like 20.
1 2 3 4 5 6 | redblock = display.newRect(60,40,80,20) redblock:setFillColor(255,0,0) blueblock = display.newRect(40,2,80,20) blueblock:setFillColor(0,0,255) transition.to(blueblock,{time=1000,x=60}) transition.to(blueblock,{time=1000,y=70}) |
Note that the default registration point of a Corona display object is its center. For example, if you create a rectangle with display.newRect( 10, 10, 300, 300), then its initial position will be x = 160, y = 160.
If you would like to position an object by its top left corner (for example), you can change its registration point like this:
object:setReferencePoint( display.TopLeftReferencePoint )
For more information, see "Display Objects: Common Object Methods" in the API Reference (page 50 of the current-edition PDF).