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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:46:23+00:00 2026-05-18T04:46:23+00:00

Hello awesome dev community. I have looked for an answer to this for days

  • 0

Hello awesome dev community.
I have looked for an answer to this for days now and just can’t seem to find a handle, so decided to post Q myself.

I have a game that has menus for picking items.
The menus can have 2 -> 30+ items, so they need to scroll. There are also category menus, which when an item is clicked, a new menu with that category’s items appears.

I figured that the most efficient way to go about it is by creating all the elements needed for the menu on a dedicated layer.
The issue is that I have no idea how to call my addNewItems:itemsArray function defined in the main game scene, from the CCLayer containing the menu.

Or, should I just use one layer? A bit messy and difficult to move multiple items together.

Thank you so much for any help – or pointing me in the direction of a clear tutorial or examples of how to do that since I honestly couldn’t find any.

Below is a flowchart of what I’m looking to create.

Thanks!!

Hanaan

alt text

  • 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-18T04:46:24+00:00Added an answer on May 18, 2026 at 4:46 am

    Finally got an answer from David994A (cocos2d forum)

    The answer is to pass the layer a pointer to it’s parent layer
    I initialize the CCLayer like this:

    -(id) initWithParent:(CCLayer *)parentLayer;

    and call it like this:

    ItemsMenuLayer *tempLayer = [[ItemsMenuLayer alloc] initWithParent:self];

    Then, from inside the CClayer I can call any of the parent’s layer functions, like this:

    [parentLayer functionName];

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

Sidebar

Related Questions

Hello can anybody solve this please I'm creating the object in the action class
Consider this string hello awesome <a href= rel=external title=so awesome is cool> stuff stuff
I have a textbox where a user puts a string like this: hello world!
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello I am working with a simulator that uses rcS scripts to boot, this
Hello we have an SQL server application running over a low bandwith connection. We
I hope this question is not 'controversial' - I'm just basically asking - has
I need to parse a string like this: a[metadata][][name]=dont|do|this&a[name]=Hello World&a[metadata][][value]=i|really|mean it CGI::parse gives me
Hello Stack Overflow contributers, I'm a novice programmer learning Python right now, and I
Hello I have two dependants select box, the second one is popularited after onchange

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.