Every time you create a new display object (image, rect, circle, etc.) in Corona SDK a “reference point” is attached to that object behind the scenes. That point determines exactly how the object is positioned on the screen.
Here’s a videos showing what that’s all about and then there’s a bunch of variables afterwards you can use in your code if you like.
This video will be available here for one week and then can be found at MasteringCoronaSDK.com for Gold members only.
1 2 3 4 5 6 7 8 9 |
display.tl = display.TopLeftReferencePoint display.tc = display.TopCenterReferencePoint display.tr = display.TopRightReferencePoint display.cl = display.CenterLeftReferencePoint display.c = display.CenterReferencePoint display.cr = display.CenterRightReferencePoint display.bl = display.BottomLeftReferencePoint display.bc = display.BottomCenterReferencePoint display.br = display.BottomRightReferencePoint |
Daniel from http://thatssopanda.com asked me whether this affects the rotation point of an object. Yep, wherever you set the reference point, that’s where the image will rotate around. Makes it really handy to create some cool looking effects, simply by changing the reference point and then doing a rotation.
Please, notify me if you have good tutorials about Corona SDK
Thanks
I have good tutorials (well, my Mom thinks they’re good) over at http://MasteringCoronaSDK.com
Jay