Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sprite kit SpriteKit-为场景的比例设置动画没有效果_Sprite Kit_Skscene - Fatal编程技术网

Sprite kit SpriteKit-为场景的比例设置动画没有效果

Sprite kit SpriteKit-为场景的比例设置动画没有效果,sprite-kit,skscene,Sprite Kit,Skscene,通过实现以下代码,我收到以下错误消息: SKScene:为SKScene的比例设置动画没有效果 _popup = [SKSpriteNode spriteNodeWithImageNamed:@"popup.png"]; [_popup.texture setFilteringMode:SKTextureFilteringNearest]; _popup.position = CGPointMake(self.frame.size.width/2, self.frame.size.width)

通过实现以下代码,我收到以下错误消息:

SKScene:为SKScene的比例设置动画没有效果

_popup = [SKSpriteNode spriteNodeWithImageNamed:@"popup.png"];
[_popup.texture setFilteringMode:SKTextureFilteringNearest];
_popup.position =  CGPointMake(self.frame.size.width/2, self.frame.size.width);
[self addChild:_popup];
SKAction *appear = [SKAction scaleTo:1.6 duration:0.5];
SKAction *wait = [SKAction waitForDuration:10.0];
SKAction *disappear = [SKAction scaleTo:0.0 duration:0.5];
SKAction *removeFromParent = [SKAction removeFromParent];
SKAction *sequence = [SKAction sequence:@[appear, wait, disappear, removeFromParent, [SKAction runBlock:^{
    [self newScene];
}]]];
[self runAction:sequence];
你有什么想法吗

编辑

这是工作代码:

_popup = [SKSpriteNode spriteNodeWithImageNamed:@"popup.png"];
_popup.position =  CGPointMake(self.frame.size.width/2, self.frame.size.width);
[self addChild:_popup];
SKAction *appear = [SKAction scaleTo:1.6 duration:0.5];
SKAction *wait = [SKAction waitForDuration:5.0];
SKAction *disappear = [SKAction scaleTo:0.0 duration:0.5];
SKAction *remove = [SKAction removeFromParent];
SKAction *rblock = [SKAction runBlock:^{ [self newScene]; }];
SKAction *sequence = [SKAction sequence:@[appear, wait, disappear, rblock, remove]];
[_popup runAction:sequence];

重要的是在“删除”之前加上“rblock”,并将“[self runAction:sequence];”更改为“[\u popup runAction:sequence];”。就这些

可能与我看到的解决方案重复,但它不与我的代码(IMHO)一起运行。场景的scaleMode设置为什么?SKSCENESCALEMODE AspectFit