2012-04-19 14:35:52 +08:00
|
|
|
#include "testBasic.h"
|
|
|
|
#include "controller.h"
|
2013-10-16 16:48:39 +08:00
|
|
|
#include "extensions/cocos-ext.h"
|
2013-10-16 11:19:01 +08:00
|
|
|
#include "cocostudio/CocoStudio.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2014-04-15 03:21:18 +08:00
|
|
|
TestScene::TestScene(bool bPortrait)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2014-04-15 03:21:18 +08:00
|
|
|
Scene::init();
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
void testScene_callback(Ref *sender )
|
2013-11-23 05:40:32 +08:00
|
|
|
{
|
|
|
|
auto scene = Scene::create();
|
|
|
|
|
|
|
|
auto layer = new TestController();
|
|
|
|
scene->addChild(layer);
|
|
|
|
layer->release();
|
|
|
|
|
|
|
|
Director::getInstance()->replaceScene(scene);
|
|
|
|
|
2013-12-27 20:54:05 +08:00
|
|
|
cocostudio::ArmatureDataManager::destroyInstance();
|
2013-11-23 05:40:32 +08:00
|
|
|
}
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
void TestScene::onEnter()
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
Scene::onEnter();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
//add the menu item for back to main menu
|
2014-03-26 23:33:58 +08:00
|
|
|
TTFConfig ttfConfig("fonts/arial.ttf", 20);
|
|
|
|
auto label = Label::createWithTTF(ttfConfig,"MainMenu");
|
|
|
|
|
2013-11-23 05:40:32 +08:00
|
|
|
auto menuItem = MenuItemLabel::create(label, testScene_callback );
|
|
|
|
auto menu = Menu::create(menuItem, NULL);
|
2012-10-23 17:48:50 +08:00
|
|
|
|
2014-04-15 18:23:40 +08:00
|
|
|
menu->setPosition( Vector2::ZERO );
|
|
|
|
menuItem->setPosition( Vector2( VisibleRect::right().x - 50, VisibleRect::bottom().y + 25) );
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
addChild(menu, 1);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|