I am using a CCMenu for a level selector layer.
I see that CCMenuItemImage supports a disabled image, but how to i set it, so it displays that disabled image?
[CCMenuItemImage isEnabled: NO]; // does not work.
A fast, easy to use, free, and community supported 2D game engine
I am using a CCMenu for a level selector layer.
I see that CCMenuItemImage supports a disabled image, but how to i set it, so it displays that disabled image?
[CCMenuItemImage isEnabled: NO]; // does not work.
I don't know how you even got that without errors, as isEnabled is not class property/method.
CCMenuItemImage *item1 = [........];
[item1 setEnabled:NO];
*Check for possible typos as I am not behind Mac
I missed typed what i said my first post, i did it like you said, but it still does not set the "disabledImage" active.
CCMenuItemImage *itemSun = [CCMenuItemImage itemFromNormalImage:@"Sun.png" selectedImage:@"Sun_over.png" disabledImage:@"Sun_disabled" target:self selector:@selector(sun:)];
[itemSun isEnabled: NO];
this will just make it unclickable, i want it to show the image i set in the "constructor"
I believe what you are looking for is a tooglebutton menu, if I understood correctly you want to click the menuItem and the it stays selected after releasing the touch right?
Ok, first told you to check for typos, so correct syntax is:
[itemSun setIsEnabled:NO];
Second, disabledImage:@"Sun_disabled" should be disabledImage:@"Sun_disabled.png"
thanks, that was it.
[itemSun isEnabled: NO];
supposed to be:
[itemSun setIsEnabled:NO];
You must log in to post.