Questions tagged [ccmenuitem]

CCMenuItem is a class from the popular Cocos2d engine.

CCMenuItem is a class from the popular Cocos2d engine. It is used as an item of a CCMenu.

CCMenuItem itself has minimal functionality, its subclasses are used to create the different types of menus such as CCMenuItemImage and CCMenuItemFont.

CCMenuItem inherits from CCNode and as such can be transformed using CCActions or manually using the properties of CCNode.

Documentation cocos2d-iphone 1.1,

http://www.cocos2d-iphone.org/api-ref/1.1.0/interface_c_c_menu_item.html

Documentation cocos2d-iphone 2.0,

http://www.cocos2d-iphone.org/api-ref/2.0.0/interface_c_c_menu_item.html

59 questions
0
votes
1 answer

CCMenu children transition seperatly

I'm adding CCMenuItems in a loop, and then moving in the CCMenu onscreen with EaseIn. Is there a way to move each CCMenuItem on its own? CGSize winSize = [[CCDirector sharedDirector] winSize]; CCMenu *chapterMenu = [CCMenu menuWithItems: nil]; …
iamruskie
  • 766
  • 4
  • 9
  • 22
0
votes
2 answers

Can't hide CCMenuItem when using In-App-Purchase

This time I would like to ask if anybody had such strange problem with disabling button (CCMenuItemImage) in cocos2d. I have in-App-Purchase connected and when purchase is done following function is triggered -…
johnnyGor
  • 161
  • 1
  • 3
  • 16
0
votes
1 answer

Cocos2d: call selector in selected method of CCMenuItem

I would like to call the target selector (see below: buttonPressedWithId:) when the "selected" method of a CCMenuItemSprite is called. CCMenuItemSprite *buttonB = [CCMenuItemSprite itemWithNormalSprite:[CCSprite…
mm24
  • 9,280
  • 12
  • 75
  • 170
0
votes
1 answer

Making a button-click exclusive to the picture of the button?

I'm having an odd, irritating issue. For example, in my main menu screen, I have a button that says "Instructions." Once I click that, in the instructions layer, there is a button that takes you back to the main menu. However, for some reason, the…
Surz
  • 984
  • 3
  • 11
  • 36
0
votes
0 answers

CCMenuItem Background Color

I'm using the Cocosbutton class to create a button which is added to the scene. This creates a CCSprite which is added to a CCMenuItem inside a CCMenu: @interface CocosButtonItem : CCMenuItem { ... In the init method, the background is added: …
Echilon
  • 10,064
  • 33
  • 131
  • 217
0
votes
1 answer

cocos2d-Menu's label shown on layer but doesn't react to touch

I don't know whats wrong, maybe because i'm using more layers? I think that my other layer (sliding menu grid subclass is stealing the touches...) // // BGLayer.m // MainProject // // Created by NSSL1 on 8/30/12. // …
Idan Banani
  • 131
  • 2
  • 13
0
votes
1 answer

Adding CCLayer to CCMenu

How can a CCLayer subclass be added to a CCMenu? I have a CCLayer subclass that's like a switch control and I'd like to include in a CCMenu.
SundayMonday
  • 19,147
  • 29
  • 100
  • 154
0
votes
2 answers

When to use CCScene vs CCLayer?

I'm kind of a UI buff - every "screen" in my game should transition in/out when it appears or disappears. Because my game is simple in terms of resources, I thought I'd just make each "screen" a CCLayer and define a function for the transitions,…
GoldenJoe
  • 7,874
  • 7
  • 53
  • 92
0
votes
3 answers

CCMenuItemLabel doesn't run selector in simulator

I can't test this on my phone because I'm poor and a new iOS programmer so I don't know if this is just an issue with the simulator or what. Also very new to cocos2d so bear with me here. I am working on a starting screen for my game. I made a…
CaldwellYSR
  • 3,056
  • 5
  • 33
  • 50
0
votes
2 answers

memory issue when passing the cclayer to my objects

I've got a CCLayer where I want to add many buttons. I created the class MyButton with this init function: -(id) initWithLayer:(MyLayer *)theLayer andDictionary:(NSDictionary *)data { self = [super init]; if (self != nil) { self.layer =…
nano
  • 2,511
  • 4
  • 25
  • 42
0
votes
0 answers

CCMenuItemSprite strange behavior Kobold2d new iPad

I'm developing a game and I'm having some troubles in my second scene. I have a CCLayer class "NewGameLayer" that contains a CCLayer as a child "bookLayer", the "NewGameLayer" contains a CCSprite as child that is a custom keyboard that animates like…
Rafael Jimeno
  • 626
  • 2
  • 8
  • 20
0
votes
2 answers

CCMenuItem doesn't respond subclassing and adding cctouch methods to CCMenu

I'm making a menu, and I want one of the buttons to respond when user touch it down, so I made a subclass of CCMenu in order to add cctouchbegan method And manage it there. The problem is that I can make it to respond both things (menuItem &…
Oscar
  • 1,899
  • 1
  • 22
  • 32
0
votes
1 answer

Working with CCMenu in cocos2d

Hi guys! I'm trying to work with CCMenu class. I've this method: -(void)showMenuItems { CGSize size = [[CCDirector sharedDirector] winSize]; [CCMenuItemFont setFontSize:28]; CCMenuItem *runAlertItem = [CCMenuItemFont…
Anatoliy Gatt
  • 2,501
  • 3
  • 26
  • 42
0
votes
1 answer

How do you place a ccmenuitem with a cclabel underneath it?

In cocos2d-iphone, I would like to use a sprite for the menu button item and I'd like to place a label underneath it describing the button. However, I am not sure how to do this. If I attempt to make more buttons/labels and then use [menu…
zardon
  • 2,910
  • 6
  • 37
  • 58
1 2 3
4