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 968571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:30:15+00:00 2026-05-16T02:30:15+00:00

I have created a normal app – initially without cocos2d. Now I need cocos2d

  • 0

I have created a “normal” app – initially without cocos2d. Now I need cocos2d in this app. So I added all the frameworks that are included when creating a cocos2d app and just copied the cocos2d group from another project by dragging it to my project.

For the init for cocos2d I get the application’s window in an ivar of the ViewController which runs the init.

@interface MyViewController : UIViewController <UINavigationControllerDelegate> {
    UIWindow *window;

}
@property (nonatomic, retain) IBOutlet UIWindow *window;


- (void) setupMyVC;

@end

@implementation MyViewController

@synthesize window;

-(void) viewDidLoad {
    [self setupMyVC];
}

- (void) setupMyVC
{
    //get the mainWindow for the CC_DIRECTOR_INIT() 
    MyAppDelegate *mainDelegate = (MyAppDelegate *)[[UIApplication sharedApplication]delegate];
    self.window = mainDelegate.mainWindow;




    // CC_DIRECTOR_INIT()
    //
    // 1. Initializes an EAGLView with 0-bit depth format, and RGB565 render buffer
    // 2. EAGLView multiple touches: disabled
    // 3. creates a UIWindow, and assign it to the "window" var (it must already be declared)
    // 4. Parents EAGLView to the newly created window
    // 5. Creates Display Link Director
    // 5a. If it fails, it will use an NSTimer director
    // 6. It will try to run at 60 FPS
    // 7. Display FPS: NO
    // 8. Device orientation: Portrait
    // 9. Connects the director to the EAGLView
    //
    CC_DIRECTOR_INIT();

    // Obtain the shared director in order to...
    CCDirector *director = [CCDirector sharedDirector];

    // Sets landscape mode
    [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];

    // Turn on display FPS
    [director setDisplayFPS:YES];

    // Turn on multiple touches
    EAGLView *view = [director openGLView];
    [view setMultipleTouchEnabled:YES];

    // Default texture format for PNG/BMP/TIFF/JPEG/GIF images
    // It can be RGBA8888, RGBA4444, RGB5_A1, RGB565
    // You can change anytime.
    [CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];    


    [[CCDirector sharedDirector] runWithScene: [RecScene scene]];
}


@end

The code works – EXCEPT THAT I GET A WHITE RECTANGLE in the lower left corner (about 5 x 20 large). This rectangle is on top of every sprite I add.

Is that OK, just to drag the cocos2d Group into my app + adding the required frameworks to integrate cocos2d?

Is there something missing?

Or where does the rectangle come from?

Tanks so much for your help!

  • 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-05-16T02:30:16+00:00Added an answer on May 16, 2026 at 2:30 am

    This could indicate that you forgot to add the file fps_images.png to your project’s resources. In the lower left corner cocos2d displays the current framerate if enabled. Since you have it enabled with

    [director setDisplayFPS:YES];
    

    I strongly assume that this is your problem. Either turn of the FPS display or add the fps_images.png to your project’s resources.

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

Sidebar

Related Questions

I have this web app created using MVC3 and need to make a Windows
I have created a few classes that operate separately from the normal aspx.cs files.
I have created two Android app's (soundboards). One version is normal, other one is
My Delphi app has created a squence called frame_001.png to frame_100.png. I need that
Have created an app-id as normal. Then created an app-store distribution profile...as normal. Set
I have created a simple native iPhone app. This project contains with c,c++ source
I have a peculiar problem. I created a normal Objective C class called SampleTable.
I have created some JQuery that will expand a div 'popup' on hover and
I have created an android application that calls (using kSOAP library) a SOAP based
I have created a function that shows/hides different messages according to a combination of

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.