문제

어떻게해야합니까?

내 UIViews (NIB 파일) 중 하나에서 imageView와 전체 화면 coacos2d 장면을 시작하는 버튼이 있습니다.그 장면 내에서 나는 그것을 닫고 UIView로 돌아가서 UIView로 돌아가서 사용자가 을 다시 열 수 있지만 ImageView의 다른 이미지에서 (그리고 장면에 다른 콘텐츠).

그러나 처음으로 "닫기"장면 전체 앱은 모든 터치 이벤트에 많이 느려집니다.장면이 켜져있는 한 빨리 작동하지만 닫을 때 성능이 내려갑니다.

어떻게 다시 시작할 수 있도록 장면을 올바르게 닫아야합니까?많은 코드 샘플을 탐색했으며 모든 곳에서는 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