mirror of https://github.com/axmolengine/axmol.git
fixed #599, Resolve the wrong orientation when exit the TouchesTest.
This commit is contained in:
parent
47ab9602a8
commit
e6bc8d7c98
|
@ -113,6 +113,8 @@ static TestScene* CreateTestScene(int nIdx)
|
||||||
TestController::TestController()
|
TestController::TestController()
|
||||||
: m_tBeginPos(CCPointZero)
|
: m_tBeginPos(CCPointZero)
|
||||||
{
|
{
|
||||||
|
CCDirector::sharedDirector()->setDeviceOrientation(CCDeviceOrientationPortrait);
|
||||||
|
|
||||||
// add close menu
|
// add close menu
|
||||||
CCMenuItemImage *pCloseItem = CCMenuItemImage::itemFromNormalImage(s_pPathClose, s_pPathClose, this, menu_selector(TestController::closeCallback) );
|
CCMenuItemImage *pCloseItem = CCMenuItemImage::itemFromNormalImage(s_pPathClose, s_pPathClose, this, menu_selector(TestController::closeCallback) );
|
||||||
CCMenu* pMenu =CCMenu::menuWithItems(pCloseItem, NULL);
|
CCMenu* pMenu =CCMenu::menuWithItems(pCloseItem, NULL);
|
||||||
|
|
|
@ -44,14 +44,3 @@ TestScene::TestScene(bool bPortrait)
|
||||||
// 54321 is the tag of BackToMainMenuLayer
|
// 54321 is the tag of BackToMainMenuLayer
|
||||||
addChild(pLayer, 1000, 54321);
|
addChild(pLayer, 1000, 54321);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestScene::onExit()
|
|
||||||
{
|
|
||||||
if (m_bPortrait)
|
|
||||||
{
|
|
||||||
// turn back to the default orientation
|
|
||||||
CCDirector::sharedDirector()->setDeviceOrientation(CCDeviceOrientationPortrait);
|
|
||||||
}
|
|
||||||
|
|
||||||
CCScene::onExit();
|
|
||||||
}
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ public:
|
||||||
TestScene(bool bPortrait = false);
|
TestScene(bool bPortrait = false);
|
||||||
|
|
||||||
virtual void runThisTest() = 0;
|
virtual void runThisTest() = 0;
|
||||||
virtual void onExit();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool m_bPortrait; // indicate if this test case requires portrait mode
|
bool m_bPortrait; // indicate if this test case requires portrait mode
|
||||||
|
|
Loading…
Reference in New Issue