auto Level_item_DEL3 = MenuItemImage::create("LEVEL 3.png", "LEVEL 3.png", "LEVEL 3 D",CC_CALLBACK_1(LevelScene::DEL3B, this));
Thatās a MenuItemImage
, not a ui::Button
. Thereās a whole ui::Widget
library within cocos that handles all that kind of stuff better IMO.
Assuming that "LEVEL 3 D"
is a PNG with a disabled texture on it, how are you enabling/disabling the MenuItemImage? If itās being added to a MenuItem
or something, maybe the parent item is controlling its state?
So far it isnāt. itās always enabled and i want it to start of as disabled (Iāll sort out the whole behavior tree).
this is what Iām asking
Did Level_item_DEL3 ->setEnabled(false);
not work? https://github.com/cocos2d/cocos2d-x/blob/v3/cocos/2d/CCMenuItem.h looks like it should, since it inherits from MenuItemSprite.
I can assure you it did not work. The button IS DISABLED but the image is the same, and not āLEVEL 3 Dā
LEVEL 3D.png?
firstly check if your image is a pngā¦ secondly why doesnāt it have extension. then add it with full extension.
It was always a PNG.
What do you mean?
last file without .png
extension
oh my deary me! Thanks! nice catch