mirror of https://github.com/axmolengine/axmol.git
move create camera to Scene::initWithSize
This commit is contained in:
parent
933439c6ca
commit
2576622778
|
@ -54,16 +54,16 @@ Scene::~Scene()
|
||||||
|
|
||||||
bool Scene::init()
|
bool Scene::init()
|
||||||
{
|
{
|
||||||
//create default camera
|
|
||||||
auto camera = Camera::create();
|
|
||||||
addChild(camera);
|
|
||||||
|
|
||||||
auto size = Director::getInstance()->getWinSize();
|
auto size = Director::getInstance()->getWinSize();
|
||||||
return initWithSize(size);
|
return initWithSize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scene::initWithSize(const Size& size)
|
bool Scene::initWithSize(const Size& size)
|
||||||
{
|
{
|
||||||
|
//create default camera
|
||||||
|
auto camera = Camera::create();
|
||||||
|
addChild(camera);
|
||||||
|
|
||||||
setContentSize(size);
|
setContentSize(size);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue