2012-04-19 14:35:52 +08:00
|
|
|
#include "testBasic.h"
|
|
|
|
#include "controller.h"
|
|
|
|
|
|
|
|
TestScene::TestScene(bool bPortrait)
|
|
|
|
{
|
|
|
|
|
|
|
|
CCScene::init();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TestScene::onEnter()
|
|
|
|
{
|
|
|
|
CCScene::onEnter();
|
|
|
|
|
|
|
|
//add the menu item for back to main menu
|
|
|
|
//#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
|
2012-06-14 15:13:16 +08:00
|
|
|
// CCLabelBMFont* label = CCLabelBMFont::create("MainMenu", "fonts/arial16.fnt");
|
2012-04-19 14:35:52 +08:00
|
|
|
//#else
|
2012-06-14 15:13:16 +08:00
|
|
|
CCLabelTTF* label = CCLabelTTF::create("MainMenu", "Arial", 20);
|
2012-04-19 14:35:52 +08:00
|
|
|
//#endif
|
2013-06-08 08:21:11 +08:00
|
|
|
CCMenuItemLabel* pMenuItem = CCMenuItemLabel::create(label, [](CCObject *sender) {
|
|
|
|
CCScene* pScene = CCScene::create();
|
|
|
|
CCLayer* pLayer = new TestController();
|
|
|
|
pLayer->autorelease();
|
|
|
|
|
|
|
|
pScene->addChild(pLayer);
|
|
|
|
CCDirector::sharedDirector()->replaceScene(pScene);
|
|
|
|
});
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-06-14 15:13:16 +08:00
|
|
|
CCMenu* pMenu =CCMenu::create(pMenuItem, NULL);
|
2012-10-23 17:48:50 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
pMenu->setPosition( CCPointZero );
|
2012-10-23 17:48:50 +08:00
|
|
|
pMenuItem->setPosition( ccp( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) );
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
addChild(pMenu, 1);
|
|
|
|
}
|