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
6
votes
4 answers

Creating an Options Menu in Android

I'm trying to make an option menu in android like this link http://developer.android.com/guide/topics/ui/menus.html#options-menu but my developed menu shows not on bottom of my page but in top action bar. my xml is bellow my_options_menu.xml
A. Zalonis
  • 1,599
  • 6
  • 26
  • 41
6
votes
2 answers

Cocos2d CCMenuItem animation upon selection

I have a CCMenu with 5 CCMenuItems. When the user touches a menu item, I want the menu item to move to the right 10 pixels, to distinguish it from the others. I tried making each menu item a global variable so I could say: if (item.isSelected) {…
Seany242
  • 373
  • 7
  • 20
5
votes
3 answers

How to stop all CCTouch under a modal layer in cocos2d?

In my cocos2d game I have a "Settings" button which launches a modal layer and is meant to lock everything under it. To do this, I use a combination of a menu status method which locks all CCMenuItems and I use a coverlayer; both of which are below…
zardon
  • 2,910
  • 6
  • 37
  • 58
3
votes
2 answers

How can I activate a CCMenuItem and move a CCSprite with a single touch

Blockquote I have a CCMenuItem button that I'd like to be able to press down then while still pressed down, will create a new CCSprite that can be dragged away while still using the same press. Basically you press the button down and drag off a new…
XBXSlagHeap
  • 174
  • 1
  • 16
2
votes
0 answers

Cocos 2d CCMenu to appear

I want to use a image for 80 times (same Image) Instead of adding CCMenu 80 time there is any alternate way. CCMenuItemImage…
Ananth
  • 21
  • 1
2
votes
1 answer

cocos2d: change CCMenuItemImage when mouse passes over?

Does anyone know of an easy way to animate a CCMenuItem when the mouse passes over it. I have read this thread: Cocos2d CCMenuItem animation upon selection which seems to cover Cocoa Touch but does not work for me with OS X. The cocos2d reference…
Adam S.
  • 306
  • 2
  • 11
2
votes
1 answer

How Can I Subclass CCMenuItemImage

I get an error that says I improperly converted CCMenuItemImage to "Button" button.cpp: #include "button.h" void Button::selected(){ CCLOG("SELECTED"); } void Button::unselected(){ CCLOG("UNSELECTED"); } button.h: #ifndef BUTTON_H #define…
David Small
  • 581
  • 1
  • 10
  • 25
2
votes
1 answer

CCMenu child of child selector not firing

I have a ccmenu with a ccmenuitemsprite in a ccmenuitemsprite which has the selector. I wish for the child of child to be a play button that fires a selector but its not firing. CCMenu *menu [CCMenu menuWithItems: nil]; CCMenuItem *bg =…
iamruskie
  • 766
  • 4
  • 9
  • 22
2
votes
2 answers

Using CCMenuAdvanced - Cocos2d

I'm trying to make an items scroller of sorts for my game. I decided upon the extension CCMenuAdvanced, and I was able to implement a working menu list with working buttons. However, I don't quite understand how to properly contain my menu inside a…
Lendo92
  • 139
  • 1
  • 3
  • 11
2
votes
3 answers

CCMenuItemImage isn't showing the selected state

The documentation for CCMenuItemImage doesn't actually say what it does. There are quite a few subclass CCMenuItem. I've inherited a project that's using it as a button. CCMenuItem *start; start = [CCMenuItemImage itemFromNormalImage:[self…
bshirley
  • 8,217
  • 1
  • 37
  • 43
1
vote
0 answers

CCMenuitem not working properly after pushing the scene for the second time

I have a menuScene which has a play button. I have declared gameScene as a property in menuScene @property(nonatomic, strong) id gameScene; and now allocating the gameScene in init method of menuScene as below. self.gameScene =…
1
vote
0 answers

CCMenuItem is not working?

At first time click on Menuitem button event it run well .but when i load again -(id)init then Menuitem button event is not working. but Touch delegate is called. i have use below code: -(id) init { if( (self=[super init]) ) { …
Kirit Modi
  • 23,155
  • 15
  • 89
  • 112
1
vote
1 answer

cocos2d for each CCMenuItem

Im setting up a CCMenu, with menu Items like so: CCLabelTTF *label1 = [CCLabelTTF labelWithString:@"level 1" fontName:@"Marker Felt" fontSize:32]; CCLabelTTF *label2 = [CCLabelTTF labelWithString:@"level 2" fontName:@"Marker Felt"…
Kyle Goslan
  • 10,748
  • 7
  • 26
  • 41
1
vote
1 answer

Make CCMenutItemSprite disabled state clickable

I'm trying to make a CCMenuItem (e.g. CCMenuItemSprite) clickable in a disabled state. I've subclassed CCMenuItemSprite and overwritten these functions: -(void) selected { CCLOG(@"selected"); [super selected]; …
David Zhang
  • 346
  • 2
  • 13
1
vote
2 answers

How do i remove the hover scale on CCMenuItemLabel?

I have a CCMenuItemLabel on my scene, and when I press and hold my finger on the label it grows in size. Now I dont want that and I dont know how to do this. I've searched for cocos2d ccmenuitemlabel hover but didnt find what I was searching for.
Arbitur
  • 38,684
  • 22
  • 91
  • 128
1
2 3 4