2014-03-04 16:51:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
#include "UIScene_Editor.h"
|
|
|
|
#include "GUIEditorTest.h"
|
2014-03-11 17:13:54 +08:00
|
|
|
#include "ui/CocosGUI.h"
|
2014-03-04 16:51:35 +08:00
|
|
|
#include "UISceneManager_Editor.h"
|
|
|
|
|
|
|
|
|
|
|
|
UIScene_Editor::UIScene_Editor()
|
2014-04-09 22:53:59 +08:00
|
|
|
: _sceneTitle(nullptr)
|
|
|
|
, _touchGroup(nullptr)
|
|
|
|
, _layout(nullptr)
|
2014-03-04 16:51:35 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
UIScene_Editor::~UIScene_Editor()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
bool UIScene_Editor::init()
|
|
|
|
{
|
|
|
|
if (CCLayer::init())
|
|
|
|
{
|
|
|
|
_touchGroup = Layer::create();
|
|
|
|
addChild(_touchGroup);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-05-09 11:52:51 +08:00
|
|
|
void UIScene_Editor::previousCallback(Widget::TouchEventType event)
|
2014-03-04 16:51:35 +08:00
|
|
|
{
|
2014-05-09 11:52:51 +08:00
|
|
|
switch (event)
|
2014-03-04 16:51:35 +08:00
|
|
|
{
|
2014-05-09 11:52:51 +08:00
|
|
|
case Widget::TouchEventType::ENDED:
|
2014-03-04 16:51:35 +08:00
|
|
|
CCDirector::getInstance()->replaceScene(UISceneManager_Editor::sharedUISceneManager_Editor()->previousUIScene());
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-09 11:52:51 +08:00
|
|
|
void UIScene_Editor::nextCallback(Widget::TouchEventType event)
|
2014-03-04 16:51:35 +08:00
|
|
|
{
|
2014-05-09 11:52:51 +08:00
|
|
|
switch (event)
|
2014-03-04 16:51:35 +08:00
|
|
|
{
|
2014-05-09 11:52:51 +08:00
|
|
|
case Widget::TouchEventType::ENDED:
|
2014-03-04 16:51:35 +08:00
|
|
|
CCDirector::getInstance()->replaceScene(UISceneManager_Editor::sharedUISceneManager_Editor()->nextUIScene());
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-09 11:52:51 +08:00
|
|
|
void UIScene_Editor::toGUIEditorTestScene(Widget::TouchEventType event)
|
2014-03-04 16:51:35 +08:00
|
|
|
{
|
2014-05-09 11:52:51 +08:00
|
|
|
switch (event)
|
2014-03-04 16:51:35 +08:00
|
|
|
{
|
2014-05-09 11:52:51 +08:00
|
|
|
case Widget::TouchEventType::ENDED:
|
2014-03-04 16:51:35 +08:00
|
|
|
{
|
|
|
|
UISceneManager_Editor::sharedUISceneManager_Editor()->purge();
|
|
|
|
|
|
|
|
GUIEditorTestScene* pScene = new GUIEditorTestScene();
|
|
|
|
pScene->runThisTest();
|
|
|
|
pScene->release();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|