First of all, I need to say that the normally helpful docs are really confusing related to an object’s origin and reference point. My searching on the topic has pretty much only revealed more confusion and confused people. So, instead of asking for clarification on how it all works, I’ll just jump to the problem I need to solve.
Here’s what I want to do: Left-align or right-align an object to the very center of the screen.
Sure, I could just do something like this…
object.x = display.contentWidth\*0.5 + object.contentWidth\*0.5
But since the size of the objects change and may need to move or flip left-/right-alignment, I’d like to just tell the object which alignment to be, then where to go on the screen.
My assumption is that I need to mess with object.xReference and/or object.xOrigin, but so far my effort to figure which, and with what combination, have just baffled me. [import]uid: 136105 topic_id: 24566 reply_id: 324566[/import]
Origins, reference points, coordinates, and their relationships is tricky and probably needs to be explained with lots of examples, pictures, and comparisons.