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

  • Home
  • SEARCH
  • 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 6186699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:56:02+00:00 2026-05-24T01:56:02+00:00

So within a CCLayer I am adding an ImagePicker / Camera to the openGLView

  • 0

So within a CCLayer I am adding an ImagePicker / Camera to the openGLView and then a UIButton – all good, but now I want to add a CCLabel (and in the future CCSprites) on top of those elements.

    uip = [[UIImagePickerController alloc] init];
    uip.sourceType = UIImagePickerControllerSourceTypeCamera;
    uip.showsCameraControls = NO;
    uip.toolbarHidden = YES;
    uip.navigationBarHidden = YES;
    uip.wantsFullScreenLayout = YES;
    uip.cameraViewTransform = CGAffineTransformScale(uip.cameraViewTransform, CAMERA_TRANSFORM, CAMERA_TRANSFORM);

    [[[CCDirector sharedDirector] openGLView] addSubview:uip.view];

    arrowButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [arrowButton addTarget:self 
               action:@selector(arrowButtonClicked:)
     forControlEvents:UIControlEventTouchUpInside];

    UIImage *imgNormal = [UIImage imageNamed:@"btn_next_norm.png"];
    [arrowButton setImage:imgNormal forState:UIControlStateNormal];

    UIImage *imgPressed = [UIImage imageNamed:@"btn_next_pressed.png"];
    [arrowButton setImage:imgPressed forState:UIControlStateHighlighted];

    arrowButton.frame = CGRectMake(screenSize.width - 48.0, screenSize.height - 37.0, 48.0, 37.0);

    [[[CCDirector sharedDirector] openGLView] addSubview:arrowButton];

    CCLabelTTF* label = [CCLabelTTF labelWithString:@"Experience 1" fontName:@"Arial" fontSize:32];
    label.color = ccc3(0, 0, 0);
    CGSize size = [[CCDirector sharedDirector] winSize];
    label.position = CGPointMake(size.width / 2, size.height / 2);
   // [[[CCDirector sharedDirector] openGLView] addSubview:labe]; cant add to openGLView
  • 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-24T01:56:02+00:00Added an answer on May 24, 2026 at 1:56 am

    You need to addSubview UIView components under the openGLView as the following,

    [[[CCDirector sharedDirector] openGLView].superview addSubview:arrowButton];
    

    And then, openGLView should be transparent. “Displaying an EAGLView with transparent background on a UIImageView“

    EDIT:

    moving the Cocos on top of the UIImagePickerController

    Ok, how about the following? addSubview the cocos2d view (openGLView) on cameraOverlayView of UIImagePickerController.

    [[[CCDirector sharedDirector] openGLView].superview addSubview:uip.view];
    [[[[CCDirector sharedDirector] openGLView] removeFromSuperview];
    uip.cameraOverlayView = [[CCDirector sharedDirector] openGLView];
    

    Also, you need Making Cocos2d Transparent.

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

Sidebar

Related Questions

Within an application, I've got Secret Keys uses to calculate a hash for an
Within Ruby on Rails applications database.yml is a plain text file that stores database
Within c#, I need to be able to Connect to a remote system, specifying
Within SQL Server Integration Services (SSIS) there is the ability to setup a connection
Within our Active Directory domain, we have a MS SQL 2005 server, and a
Within your organization, is every developer required to lock his workstation when leaving it?
Within a stored procedure, another stored procedure is being called within a cursor. For
Within my Subversion project I have a few directories that contain other open source
Within an n-tier app that makes use of a WCF service to interact with
Within the last year I have become addicted to subversion. I am an only

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.