SetReferencePoint on newImageRect problem

I can’t seem to be able to set the reference point of a newImageRect. I’ve been able to do it fine with regular newImage()
[lua]local titleName = display.newImageRect(“title.png”,344,144);
titleName:setReferencePoint(display.TopCenterReferencePoint);[/lua]

I wash watching some tutorials from Dr. Rafael Hernandez and he was able to do it just fine in this video http://www.youtube.com/watch?v=XENfw2zMIsw

I’m not sure if this is a bug or if I’m doing something wrong. [import]uid: 123298 topic_id: 23572 reply_id: 323572[/import]

Maybe I’m crazy, but you need to set x/y after setting the reference point? [import]uid: 41884 topic_id: 23572 reply_id: 94537[/import]

Thanks. I see how it works now.

I didn’t know you had to set the x/y again.

Default it’s setting the referencePoint in the center and it’s at 0,0.

I thought if I just changed the reference point to CenterLeftReferencePoint the image would rest with it’s left edge at 0,0.

But you still have to go and set x and y to 0.

Thanks for the help. [import]uid: 123298 topic_id: 23572 reply_id: 94541[/import]

As a reminder, setting the reference point only changes the position at which the object is positioned/rotated (pivoted), so it doesn’t actually move/change the object in any way.

You can see the effect of the reference point by moving it or rotating it afterwards. [import]uid: 52430 topic_id: 23572 reply_id: 94617[/import]

TBH I really don’t see the point of specifying X/Y inside of the display text commands. Or at least I’ve never run into a situation where I can use them predictably. The only reliable way I can use any of the text commands is to

  1. Run the command
  2. Set reference
  3. Set X/Y

And to miguelrico3d, remember that you’ll need to re-apply referencepoint and X/Y every time you change that text. If you try to set a new.text, the results tend to be pretty messy. [import]uid: 41884 topic_id: 23572 reply_id: 94660[/import]