我使用 SKNode 的 xScale 属性水平翻转我的精灵。现在,在将 iOS 更新到 7.1 版后,水平翻转会导致我的对象沉入地下。(见下面的动画)。该问题仅出现在 xScale 属性中。垂直翻转工作正常。
// Init
{
SKSpriteNode* ground = [SKSpriteNode spriteNodeWithColor:[UIColor blackColor] size:CGSizeMake(winSize.width, 150)];
ground.position = CGPointMake(winSize.width/2, ground.size.height/2);
ground.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:ground.size center:CGPointZero];
ground.physicsBody.dynamic = NO;
ground.physicsBody.categoryBitMask = 0x01;
ground.physicsBody.collisionBitMask = 0x02;
ground.physicsBody.contactTestBitMask = 0x02;
[self.world addChild:ground];
SKSpriteNode* turtle = [SKSpriteNode spriteNodeWithImageNamed:@"turtle.png"];
turtle.physicsBody = [SKPhysicsBody bodyWithCircleOfRadius:turtle.size.width/2];
turtle.physicsBody.categoryBitMask = 0x02;
turtle.physicsBody.collisionBitMask = 0x01;
turtle.physicsBody.contactTestBitMask = 0x01;
turtle.position = CGPointMake(winSize.width/2, winSize.height/2);
[self.world addChild:turtle];
self.turtle = turtle;
}
// Somewhere else
{
self.turtle.xScale *= -1;
}