gpt4 book ai didi

iphone - 有没有办法暂停 SKActions?

转载 作者:可可西里 更新时间:2023-11-01 03:05:25 25 4
gpt4 key购买 nike

我想创建一个暂停菜单,但我不知道最简单的方法...我认为一个简单的方法是暂停我所有的 SKActions,但我在引用资料中找不到任何方法。感谢您的帮助。

最佳答案

文档说父 SKView 对象有一个暂停的属性。将其设置为 YES 以暂停场景。

Paused

A Boolean value that indicates whether the view’s scene animations are paused.

@property(getter=isPaused, nonatomic) BOOL paused

Discussion If the value is YES, then the scene’s content is fixed on screen. No actions are executed and no physics simulation is performed."

//the parent SKView
spriteView = (SKView *) self.view;

//pause button
-(IBAction)goPauseButton {
if(!spriteView.paused){
spriteView.paused = YES;
}else{
spriteView.paused = NO;
}
}

关于iphone - 有没有办法暂停 SKActions?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19346287/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com