質問

どうすればいいですか?

私のUIView(NIBファイル)のいずれかに、私はFull Screen Cocos2Dシーンを開始するImageViewとボタンを持っています。そのシーンの中から、私はそれを閉じてuiviewに戻りたいので、ユーザーが後でを再び開くことができますが画像ビューの異なるイメージから(そしてシーン上の異なるコンテンツで)。

しかし、私が初めて「閉じる」シーンを "閉じる"アプリ全体がすべてのタッチイベントに遅く反応します。シーンが点灯している限り、それは急速に機能しますが、閉じてパフォーマンスが低下します。

私はどのように私は再び再起動することができるようにシーンを正しく閉じるべきですか?私はたくさんのコードサンプルを閲覧し、どこでもreplaceWithScene:newSceneです。

役に立ちましたか?

解決

Adding a UIView to a viewController that houses a running openGL layer slows the app, as anyone who has tried to incorporate a UIScrollView into a Cocos2D game can tell you. You are closing the scene, but likely not stopping the CCDirector, which is now running its own scheduler aside the application's scheduler. As they fight for dominance over the CPU, OpenGL invariably wins as it needs more power more often.

Ensure you are completely shutting down cocos2D and OpenGL. Even if only calling [[CCDirector sharedDirector] pause].

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top