add test case

This commit is contained in:
Huabing.Xu 2013-11-27 10:35:23 +08:00
parent 3da196ea43
commit dd6c14e88d
2 changed files with 47 additions and 0 deletions

View File

@ -21,6 +21,7 @@ static std::function<Layer*()> createFunctions[] =
CL(NewSpriteBatchTest),
CL(NewClippingNodeTest),
CL(NewDrawNodeTest),
CL(NewCullingTest),
};
#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0]))
@ -401,3 +402,36 @@ string NewDrawNodeTest::subtitle()
{
return "DrawNode";
}
NewCullingTest::NewCullingTest()
{
auto s = Director::getInstance()->getWinSize();
auto parent = Node::create();
parent->setPosition(s.width/2, s.height/2);
addChild(parent);
auto parent2 = Node::create();
parent2->setPosition(0,0);
parent->addChild(parent2);
parent2->runAction(RepeatForever::create((JumpBy::create(2, Point(0,0), 300, 1))));
NewSprite* sprite = NewSprite::create("Images/grossini.png");
sprite->setPosition(Point(0,0));
sprite->runAction(RepeatForever::create(RotateBy::create(3, 360)));
parent2->addChild(sprite);
}
NewCullingTest::~NewCullingTest()
{
}
string NewCullingTest::title()
{
return "New Render";
}
string NewCullingTest::subtitle()
{
return "Culling";
}

View File

@ -107,4 +107,17 @@ protected:
virtual ~NewDrawNodeTest();
};
class NewCullingTest : public MultiSceneTest
{
public:
CREATE_FUNC(NewCullingTest)
virtual string title();
virtual string subtitle();
protected:
NewCullingTest();
virtual ~NewCullingTest();
};
#endif //__NewRendererTest_H_