mirror of https://github.com/axmolengine/axmol.git
fix a typo error
This commit is contained in:
parent
ee08c4629e
commit
481f1c2532
|
@ -135,7 +135,7 @@ TestController::TestController()
|
||||||
pCloseItem->setPosition(CCPointMake( s.width - 30, s.height - 30));
|
pCloseItem->setPosition(CCPointMake( s.width - 30, s.height - 30));
|
||||||
|
|
||||||
// add menu items for tests
|
// add menu items for tests
|
||||||
m_pItmeMenu = CCMenu::menuWithItems(NULL);
|
m_pItemMenu = CCMenu::menuWithItems(NULL);
|
||||||
for (int i = 0; i < TESTS_COUNT; ++i)
|
for (int i = 0; i < TESTS_COUNT; ++i)
|
||||||
{
|
{
|
||||||
// #if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
|
// #if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
|
||||||
|
@ -145,13 +145,13 @@ TestController::TestController()
|
||||||
// #endif
|
// #endif
|
||||||
CCMenuItemLabel* pMenuItem = CCMenuItemLabel::itemWithLabel(label, this, menu_selector(TestController::menuCallback));
|
CCMenuItemLabel* pMenuItem = CCMenuItemLabel::itemWithLabel(label, this, menu_selector(TestController::menuCallback));
|
||||||
|
|
||||||
m_pItmeMenu->addChild(pMenuItem, i + 10000);
|
m_pItemMenu->addChild(pMenuItem, i + 10000);
|
||||||
pMenuItem->setPosition( CCPointMake( s.width / 2, (s.height - (i + 1) * LINE_SPACE) ));
|
pMenuItem->setPosition( CCPointMake( s.width / 2, (s.height - (i + 1) * LINE_SPACE) ));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pItmeMenu->setContentSize(CCSizeMake(s.width, (TESTS_COUNT + 1) * (LINE_SPACE)));
|
m_pItemMenu->setContentSize(CCSizeMake(s.width, (TESTS_COUNT + 1) * (LINE_SPACE)));
|
||||||
m_pItmeMenu->setPosition(s_tCurPos);
|
m_pItemMenu->setPosition(s_tCurPos);
|
||||||
addChild(m_pItmeMenu);
|
addChild(m_pItemMenu);
|
||||||
|
|
||||||
setIsTouchEnabled(true);
|
setIsTouchEnabled(true);
|
||||||
|
|
||||||
|
@ -200,22 +200,22 @@ void TestController::ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent)
|
||||||
touchLocation = CCDirector::sharedDirector()->convertToGL( touchLocation );
|
touchLocation = CCDirector::sharedDirector()->convertToGL( touchLocation );
|
||||||
float nMoveY = touchLocation.y - m_tBeginPos.y;
|
float nMoveY = touchLocation.y - m_tBeginPos.y;
|
||||||
|
|
||||||
CCPoint curPos = m_pItmeMenu->getPosition();
|
CCPoint curPos = m_pItemMenu->getPosition();
|
||||||
CCPoint nextPos = ccp(curPos.x, curPos.y + nMoveY);
|
CCPoint nextPos = ccp(curPos.x, curPos.y + nMoveY);
|
||||||
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
|
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
|
||||||
if (nextPos.y < 0.0f)
|
if (nextPos.y < 0.0f)
|
||||||
{
|
{
|
||||||
m_pItmeMenu->setPosition(CCPointZero);
|
m_pItemMenu->setPosition(CCPointZero);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextPos.y > ((TESTS_COUNT + 1)* LINE_SPACE - winSize.height))
|
if (nextPos.y > ((TESTS_COUNT + 1)* LINE_SPACE - winSize.height))
|
||||||
{
|
{
|
||||||
m_pItmeMenu->setPosition(ccp(0, ((TESTS_COUNT + 1)* LINE_SPACE - winSize.height)));
|
m_pItemMenu->setPosition(ccp(0, ((TESTS_COUNT + 1)* LINE_SPACE - winSize.height)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pItmeMenu->setPosition(nextPos);
|
m_pItemMenu->setPosition(nextPos);
|
||||||
m_tBeginPos = touchLocation;
|
m_tBeginPos = touchLocation;
|
||||||
s_tCurPos = nextPos;
|
s_tCurPos = nextPos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CCPoint m_tBeginPos;
|
CCPoint m_tBeginPos;
|
||||||
CCMenu* m_pItmeMenu;
|
CCMenu* m_pItemMenu;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue