Question

I want to create a menu in cocos3d. I failed to find correct solution for this. I tried to create one using the cocos2d concept.

    CCMenuItemImage *item1=[CCMenuItemImage itemFromNormalImage:@"up.png" selectedImage:@"images.jpeg" target:self selector:@selector(up:)];
    CCMenu *mnu1=[CCMenu menuWithItems:item1, nil];
    mnu1.position=ccp(320, 480);
    [self addChild:mnu1];

But there comes an issue,

Incompatible pointer types sending 'CCMenu *' to parameter of type 'CC3Node *'

Was it helpful?

Solution

I found the answer. I had created CCMenu in CCScene. Actually we have to create CCMenu in CCLayer. Now it works !

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top