2010-08-06 17:50:20 +08:00
|
|
|
#include "tests.h"
|
|
|
|
#include "controller.h"
|
2010-08-13 17:21:33 +08:00
|
|
|
#include "CCMenu.h"
|
|
|
|
#include "CCBitmapFontAtlas.h"
|
2010-08-06 17:50:20 +08:00
|
|
|
#include "touch_dispatcher/CCTouchDispatcher.h"
|
|
|
|
|
|
|
|
TestController::TestController()
|
|
|
|
{
|
|
|
|
/**
|
2010-08-09 18:07:50 +08:00
|
|
|
@todo add menu items for all tests
|
2010-08-06 17:50:20 +08:00
|
|
|
*/
|
2010-08-13 17:21:33 +08:00
|
|
|
CCBitmapFontAtlas* label = CCBitmapFontAtlas::bitmapFontAtlasWithString("ActionsTest", "/NEWPLUS/TDA_DATA/Data/cocos2d_tests/Images/bitmapFontTest3.fnt");
|
|
|
|
CCMenuItemLabel* pMenuItem = CCMenuItemLabel::itemWithLabel(label, this, menu_selector(TestController::menuCallback));
|
2010-08-06 17:50:20 +08:00
|
|
|
|
2010-08-13 17:21:33 +08:00
|
|
|
CCMenu* pMenu =CCMenu::menuWithItems(pMenuItem, NULL);
|
|
|
|
CGSize s = CCDirector::getSharedDirector()->getWinSize();
|
|
|
|
pMenu->setPosition( CGPointZero );
|
|
|
|
pMenuItem->setPosition( CGPointMake( s.width / 2, s.height / 2) );
|
2010-08-06 17:50:20 +08:00
|
|
|
|
2010-08-13 17:21:33 +08:00
|
|
|
addChild(pMenu, 1);
|
2010-08-06 17:50:20 +08:00
|
|
|
}
|
|
|
|
|
2010-08-13 17:21:33 +08:00
|
|
|
void TestController::menuCallback(NSObject * pSender)
|
2010-08-06 17:50:20 +08:00
|
|
|
{
|
|
|
|
TestScene* pScene = new ActionsTestScene();
|
|
|
|
|
|
|
|
pScene->runThisTest();
|
|
|
|
}
|