Closed vcarluer closed 11 years ago
Create another sprite with the same frsme for different menu states. 08.11.2012 5:19 ÐÏÌØÚÏ×ÁÔÅÌØ "Vincent Carluer" notifications@github.com ÎÁÐÉÓÁÌ:
I've updated my cocos2d-android from february 2012 to november version and my menus with sprites are not displayed anymore. CCMenuItemSprite are here because when I select them they appear but normal image is not displayed anymore. I search a little bit in the code but didn't find anything, did you changed something?
code sample:
CCSprite pauseSprite = CCSprite.sprite("control-pause.png", true); CCMenuItemSprite pauseMenu = CCMenuItemSprite.item(pauseSprite, pauseSprite, this, "goPause"); pauseMenu.setScale(pauseScale);
float left = - CCDirector.sharedDirector().winSize().getWidth() / 2 + ((MenuSprite.Width * pauseScale) + PauseLayer.PaddingX) / 2 ; float top = CCDirector.sharedDirector().winSize().getHeight() / 2 - ((MenuSprite.Height * pauseScale) + PauseLayer.PaddingY) / 2; pauseMenu.setPosition(CGPoint.make(left, top)); this.menu = CCMenu.menu(pauseMenu); this.addChild(this.menu);
-- Reply to this email directly or view it on GitHubhttps://github.com/ZhouWeikuan/cocos2d/issues/67.
You are right, it works thanks! New menu code: CCSprite playSpriteNorm = CCSprite.sprite("control-play.png", true); CCSprite playSpriteSel = CCSprite.sprite("control-play.png", true); CCMenuItemSprite playMenu = CCMenuItemSprite.item(playSpriteNorm, playSpriteSel, this, "selectPlay");
I've updated my cocos2d-android from february 2012 to november version and my menus with sprites are not displayed anymore. CCMenuItemSprite are here because when I select them they appear but normal image is not displayed anymore. I search a little bit in the code but didn't find anything, did you changed something?
code sample:
CCSprite pauseSprite = CCSprite.sprite("control-pause.png", true); CCMenuItemSprite pauseMenu = CCMenuItemSprite.item(pauseSprite, pauseSprite, this, "goPause"); pauseMenu.setScale(pauseScale);