0
下面的代码生成精灵并分配定位点和旋转。精灵会旋转很多,有没有办法获得精灵右下角的位置。就像,精灵的定位点是(0,1),我可以得到定位点(1,1)的位置吗?这样,即使它正在旋转,我总能得到精灵的相同位置?获取精灵部分的位置
tempsprite = [CCSprite spriteWithSpriteFrameName:@"image.png"];
tempsprite.rotation += 90;
tempsprite.anchorPoint = ccp(0,1);
tempsprite.position = tempsprite;
[self addChild:tempsprite];
这有点哈克,但它的工作原理。 – user2121776