ios - SKTransition transitionWithCIFilter :duration: not animating
<p><p>我一直在尝试在 SpriteKit 中的场景之间创建翻页过渡,如下所示:</p>
<pre><code>+ (SKTransition *)pageTurnTransition {
float w = 768.0;
float h = 1024.0;
CIVector *extent = ;
CIImage *shadingImage = [ initWithColor:];
CIImage *blankImage = [ initWithColor:];
CIFilter *pageCurlFilter = [CIFilter filterWithName:@"CIPageCurlTransition"
keysAndValues:
@"inputExtent", extent,
@"inputShadingImage", shadingImage,
@"inputBacksideImage", blankImage,
@"inputAngle",,
@"inputRadius", ,
nil
];
return ;
}
</code></pre>
<p>这就是我所说的过渡:</p>
<pre><code>SKScene *spaceshipScene = [ initWithSize:self.size];
[ presentScene:spaceshipScene transition:];
</code></pre>
<p>问题在于转场没有动画,它只是在指定的(1 秒)转场持续时间内停留在原始场景,然后突然显示下一个场景。</p>
<p>有人知道我做错了什么吗?我已经在 iPad 模拟器 iOS 7.1 中对此进行了测试。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>我试过你的代码,它可以重现你的问题。</p>
<p>这似乎是 CurlTransition 的问题。如果您使用其中一种内置转换,它可以工作:</p>
<pre><code>return ;
</code></pre>
<p>您确定 shadingImage 不能是透明的吗?</p></p>
<p style="font-size: 20px;">关于ios - SKTransition transitionWithCIFilter :duration: not animating,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/23518289/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/23518289/
</a>
</p>
页:
[1]