質問

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 *'

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top