mirror of https://github.com/axmolengine/axmol.git
add test case
This commit is contained in:
parent
3da196ea43
commit
dd6c14e88d
|
@ -21,6 +21,7 @@ static std::function<Layer*()> createFunctions[] =
|
||||||
CL(NewSpriteBatchTest),
|
CL(NewSpriteBatchTest),
|
||||||
CL(NewClippingNodeTest),
|
CL(NewClippingNodeTest),
|
||||||
CL(NewDrawNodeTest),
|
CL(NewDrawNodeTest),
|
||||||
|
CL(NewCullingTest),
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0]))
|
#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0]))
|
||||||
|
@ -401,3 +402,36 @@ string NewDrawNodeTest::subtitle()
|
||||||
{
|
{
|
||||||
return "DrawNode";
|
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";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,4 +107,17 @@ protected:
|
||||||
virtual ~NewDrawNodeTest();
|
virtual ~NewDrawNodeTest();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class NewCullingTest : public MultiSceneTest
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
CREATE_FUNC(NewCullingTest)
|
||||||
|
virtual string title();
|
||||||
|
virtual string subtitle();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
NewCullingTest();
|
||||||
|
virtual ~NewCullingTest();
|
||||||
|
};
|
||||||
|
|
||||||
#endif //__NewRendererTest_H_
|
#endif //__NewRendererTest_H_
|
||||||
|
|
Loading…
Reference in New Issue