Magic_Game/ConsoleDemo/main.cpp

31 lines
533 B
C++
Raw Normal View History

2017-11-03 22:14:07 +08:00
#include <easy2d.h>
2017-10-14 01:07:34 +08:00
int main()
{
EApp app;
2017-11-04 11:11:16 +08:00
if (app.init(L"Easy2D Demo", 640, 640))
2017-10-14 01:07:34 +08:00
{
auto scene = new EScene();
2017-11-04 11:11:16 +08:00
auto sprite = new ESprite(L"test2.png");
sprite->setAnchor(-1, 0);
2017-11-03 12:51:01 +08:00
// <20><>ȡ<EFBFBD><C8A1><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD>
float width = EApp::getWidth();
// <20><>ȡ<EFBFBD><C8A1><EFBFBD>ڸ߶<DAB8>
float height = EApp::getHeight();
// <20>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
sprite->setPos(width / 2, height / 2);
//sprite->setAnchor(0, 0);
2017-11-04 11:11:16 +08:00
scene->add(sprite);
sprite->runAction(new EActionLoop(new EActionRotateBy(1, 60)));
2017-11-03 22:14:07 +08:00
2017-10-14 01:07:34 +08:00
app.enterScene(scene);
app.run();
}
return 0;
}