Okay, so here is the code in the Graphics 1.0 version:
[lua]animal[6] = display.newSprite( myImageSheet[2], spriteOptions[5] )
animal[6].xScale = animal[4].xScale
animal[6].yScale = animal[4].yScale
animal[6].xReference = -61
animal[6].x = animal[4].x + (animal[6].xReference * animal[6].xScale)
animal[6].y = animal[4].y + (0 * animal[6].yScale)
animal[6].isVisible = false[/lua]
Basically Im loading my sprite from the image sheet. I’m then setting the xReference to -61. The issue lies in the fact that xReference seems based off of the sourceWidth below in the image sheet:
[lua]SheetInfo.sheet =
{
frames = {
{
– eyes tiger 1
x=66,
y=90,
width=26,
height=6,
sourceX = 59,
sourceY = 58,
sourceWidth = 267,
sourceHeight = 160[/lua]
When switching to anchor points, the anchor point becomes based off the image width not the sourceWidth.
So no big deal except that the whole reason for the xReference was to be able to rotate the image at a certain point (-61 from the center of the sourceWidth).
I can no longer rotate at this point as the anchor point cannot go beyond the width.
How can I set the rotation point beyond the image using anchor points?
Thanks!