I created a MenuItemSprite and place them absolutely by using their position, then added them to a menu. Only about half the sprite registers a selection. Why is this?
Interesting MenuItemSprite problem
(3 posts) (2 voices)-
Posted 2 years ago #
-
Man, with such a broad question you'll likely NOT to get any valid response. MenuItemSprites should work as they are intended, I used it in many apps without problems. So I suppose problem is in your code. Just post an example, and then people would help you. Of course, there is a tiny chance you actually discovered a bug, but without a code we are all lost in the space/time continuum ;)
Posted 2 years ago # -
sorry about that
MenuItemSprite *play = [MenuItemImage itemFromNormalImage:@"blank.png" selectedImage:@"button_play.png" target:self selector:@selector(menuCallbackPlay:)]; MenuItemSprite *help = [MenuItemImage itemFromNormalImage:@"blank.png" selectedImage:@"button_help.png" target:self selector:@selector(menuCallbackHelp:)]; Menu *menu = [Menu menuWithItems: play, help, nil]; [self addChild:menu]; [play setPosition:ccp(-129, -15)]; [help setPosition:ccp(83, -15)];My menu already has the buttons in their up position in the background image, so I used a blank png (same size as the button) as the unselected image.
Posted 2 years ago #
Reply
You must log in to post.