coordinates question

I was working on page 68 of Corona SDK Mobile Game Development

And working out the differences between placement of objects
-based on display object
-local origin

While that did not make any since to me.
I noticed that
(50,50) local origin = (0,0) display

Is that always true?

I didn’t see anywhere in Chapter 2 (just finished chapter 2) anything about 50.
So, I am still confused about the display object versus local origin. I was able to work out the math behind it, but not really sure where the numbers come from. Why 50?

Can someone enlighten me?

I think maybe a picture in the book showing position of (local origin verses display object) would have made it clear. But anyway. Can someone explain?

Thank you!
[import]uid: 159663 topic_id: 28202 reply_id: 328202[/import]

I was looking for the reference in the book (page 68) and I’m not finding the same material. Could you give the chapter & topic so that I can take a look. Of course Michelle wrote this book, so I don’t claim to be able to answer the topic for you, but I’ll give it my best shot! [import]uid: 34131 topic_id: 28202 reply_id: 114101[/import]

ON page 68 where she talks about the difference between image01 (which is at 110, 30)
and image02 (shich is at 160,200)

The calculation is 110+50, 30+50
because they all have same x coordinate and there is 120 difference between each one in y

Thanks!
[import]uid: 159663 topic_id: 28202 reply_id: 114107[/import]

Did some searching… it was on page 94-5 of the ePub version.

So your question is "Why are the x & y coordinates different between image1 & image2; specifically the x coordinate.
It has to do with the implementation. In the code for image1, the x & y are given as part of the object creation for the image. In the code for image2, the x & y coordinates are set AFTER the object is created.
When you give the location as part of the initial object creation, you are setting the TOP, LEFT corner of the object (whether it is text or an image).
When you are setting the location after the object is already created, you are setting the CENTER of the image; thus the additional 50 pixels are needed to get everything to line up correctly. [import]uid: 34131 topic_id: 28202 reply_id: 114111[/import]

Thanks but my last question still stands, is it ALWAYS 50?

Thanks! [import]uid: 159663 topic_id: 28202 reply_id: 114156[/import]

No, the 50 is 50% of size of width & height (i.e. the image 100pixels by 100pixels). [import]uid: 34131 topic_id: 28202 reply_id: 114159[/import]