0
MenuItem *pageMenuItem;
pageMenuItem = MenuItemImage::create(menuImgNm, menuImgNm,
CC_CALLBACK_1(RootLayer::buttonAction, this));
我想根據某些條件更改此圖像。cocos2dx中的Menuitem更新圖像3.0
MenuItem *pageMenuItem;
pageMenuItem = MenuItemImage::create(menuImgNm, menuImgNm,
CC_CALLBACK_1(RootLayer::buttonAction, this));
我想根據某些條件更改此圖像。cocos2dx中的Menuitem更新圖像3.0
我認爲你可以這樣試試:
CCTexture2D* tex = [[CCTextureCache sharedTextureCache] addImage:@"new_image_name"]; [menuImgNm setTexture: tex];
希望得到這個幫助!