SpriteKit - Set Scale and Physics

后端 未结 3 1092
庸人自扰
庸人自扰 2020-12-09 12:38

What is the correct way to \"zoom out\" on your scene.

I have an object that I apply an impulse to fire it across the screen. It for example will fire about 100 px a

3条回答
  •  被撕碎了的回忆
    2020-12-09 12:53

    For those like me who ended up here after a search, changing the scale of the scene to zoom out no longer works. Instead, encapsulate all your nodes in an empty SKNode and run actions on this one:

    self.rootNode = [SKNode node];
    // Add your children nodes here to the rootnode.
    [self addChild:self.rootNode];
    // Zoom out
    [self.rootNode runAction:[SKAction scaleBy:2 duration:5]];
    // Zoom in
    [self.rootNode runAction:[SKAction scaleBy:.5 duration:5]];
    

    self is the SKScene. I hope this helps.

提交回复
热议问题