Sprite Rotation Offset

Hi all,

By default the point of rotation is always the object center. Does anyone know if there is a way to set the object X and Y offset or origin so that it can rotate around a different point?

Thanks!

Neil [import]uid: 173326 topic_id: 30485 reply_id: 330485[/import]

Hi Neil,

Rotations are linked to the objects reference point, normally defaulted on the centre.

Try using [lua]object:setReferencePoint( )[/lua] to change it.

API Doc: http://developer.coronalabs.com/reference/index/objectsetreferencepoint [import]uid: 62706 topic_id: 30485 reply_id: 122122[/import]

Perfect, that’s exactly what I was looking for! Thanks :)! [import]uid: 173326 topic_id: 30485 reply_id: 122123[/import]

Hi Neil,

Rotations are linked to the objects reference point, normally defaulted on the centre.

Try using [lua]object:setReferencePoint( )[/lua] to change it.

API Doc: http://developer.coronalabs.com/reference/index/objectsetreferencepoint [import]uid: 62706 topic_id: 30485 reply_id: 122122[/import]

Perfect, that’s exactly what I was looking for! Thanks :)! [import]uid: 173326 topic_id: 30485 reply_id: 122123[/import]