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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:08:52+00:00 2026-06-16T11:08:52+00:00

I am using CCUIViewWrapper Class to add UIControl in Cocos2d. Here is my code,

  • 0

I am using CCUIViewWrapper Class to add UIControl in Cocos2d.

Here is my code,

UIView  *view=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];

view.backgroundColor=[UIColor greenColor];

 CCUIViewWrapper *Wrapper = [CCUIViewWrapper wrapperForUIView:view];

 [self addchild:Wrapper];

Afte I am adding CCLabelTTF

CCLabelTTF * label=[CCLabelTTF labelWithString:@"Hi" fontName:@"Marker Felt" fontSize:32];
        label.position=ccp(160,280);
        [self addChild:label];

So, my problem is that the label does not appear.
I am also trying to change zOrder & also trying to insertSubviewatIndex.

  • 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-16T11:08:54+00:00Added an answer on June 16, 2026 at 11:08 am

    If you make a fullscreen UIKit view, it will be drawn over the cocos2d view. If that view is opaque, you won’t see any of the cocos2d view.

    By making the cocos2d view transparent (opaque = NO), setting the OpenGL clear color to alpha = 0 and changing the framebuffer to 32-Bit with alpha, you can also add UIKit views that are drawn behind the cocos2d view and its nodes.

    You can not have the same UIKit view both in front of some cocos2d nodes and behind other cocos2d nodes at the same time. It’s simply not possible. For example, this draw order can not be done:

    1. cocos2d node (sprite, label, etc)
    2. UIKit view (button, text field, table view, etc)
    3. cocos2d node (sprite, label, etc)

    You have to consider the cocos2d view with all the nodes in it as a whole (z order only affects how cocos2d nodes are drawn in relation to each other). The cocos2d view can be either completely in front or completely behind a UIkit view.

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

Sidebar

Related Questions

I am using the code from http://www.cocos2d-iphone.org/forum/topic/6889 to add a UIView to the screen
Using the DateTime class, if I try to run the following code: $mydate =
Using Play 2.1-RC1 I can't write simple test. Here's the action code: def echoTestTagFromXml
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
using this code: Java Server side: ... out = new PrintWriter(this.client.getOutputStream(), true); ... public
Using Android NDK is it possible (from native C-code) to get a list of
Using this code, the following execution yields strange results: C 100 R W The
Using the ndk I have compiled a code written in C. The program is
using Eclipse 3.4 Ganymede and I cannot find the way to add javadoc support
Using the classic code snippet: if (x & (x-1)) == 0 If the answer

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.