I am using Corona SDK Mobile Game Book
Pg 104
playBtn = display.newImage(“playbtn.png”)
playBtn:setReferencePoint(display.CenterReferencePoint)
playBtn.x = _W; playBtn.y = _H + 50
playBtn.name = “playbutton”
No information about the setReferencePoint near that page, so I went back to page 66 where they talk about object:setReferencePoint and all I could find is where it says “Sets the reference point”, I almost want to say “Duh” but don’t want to be mean. But, it tells me NOTHING about the purpose. Ok, so you set a reference point. So what? Why? What does it do?
Then I found http://developer.coronalabs.com/reference/index/objectsetreferencepoint and I got the idea that in that example - it is used to center aline text. “A picture would have been nice”
But, then I looked at this code and it was an object. So, I thought maybe it centered alined to the screen or something. So, I took it out. Nothing changed. The words didn’t change and the button didn’t change. So, I saw no point in having that command. So, is there a purpose or is this one of those times when the author is just so used to putting code in that they put it in but it is not needed?
Just curious or can someone explain the purpose here.
Also, if not used for text, what is the purpose? Again, for text, I got the opinion it was for center aligning the text, I hope I am right.
Thanks!
[import]uid: 159663 topic_id: 28278 reply_id: 328278[/import]
[import]uid: 52491 topic_id: 28278 reply_id: 114294[/import]