Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8687609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:09:34+00:00 2026-06-12T23:09:34+00:00

What I would like to do is have the Cocos2d shared director to replace

  • 0

What I would like to do is have the Cocos2d shared director to replace the current scene with a UIView from UIKit (possibly loaded from a nib). The idea being to cleanly transition between Cocos2d and UIKit.

I’ve seen a few approaches to this problem. Most of them are about mixing UIKit with Cocos2d in the same scene, I’d like to keep them separate. One approach is to add an instance of UIView as a subview of the directors GLView. Like so:

UIView* cocosView = [[CCDirector sharedDirector] openGLView];
[cocosView addSubview:t];

Overlaying a UIView onto a Cocos layer?

This works but I would have to create a blank scene and transition to that first, then add the UIView, then later remove it and transition to whatever other scene. That’s modular but a little messy.

A better approach is to wrap a UIView into a node. Something like:
http://www.cocos2d-iphone.org/forum/topic/6889

Is there an official cocos2d extension for this? I’d also like to load the UIView from storyboard/nib if possible. Much obliged.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:09:36+00:00Added an answer on June 12, 2026 at 11:09 pm

    replace the current scene with a UIView from UIKit

    if you are using cocos2d 1.x: http://www.raywenderlich.com/4817/how-to-integrate-cocos2d-and-uikit

    if you are using cocos2d 2.x: CCDirector is a subclass of UIViewController, so you can use usual methods. There’s a little bug with delta time calculation after stopping/starting animation, but it’s easy to fix.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have a makefile copy files from another directory and change
I have a Menu Scene that I would like to be Portrait Only, then
I have made a project in cocos2d 2.0 and would like to incorporate a
I have imported the extension CCVideoPlayer to my cocos2d project and I would like
I have a Cocos2d game scene that loads with an EAGLView loaded by a
I'm on cocos2d and I have a sprite that I would like to rotate
So in my project i would like have a nice treeview that has images.
I would like to have an AppWidget that designed like this one . Image:
I would like to have a more colorful Python prompt in the terminal, just
I would like to have the cursor in the JavaDoc area when creating interfaces,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.