mirror of https://github.com/axmolengine/axmol.git
Merge pull request #7979 from giginet/scene-reader-canvas-size
SceneReader sets contentSize by canvasSize.
This commit is contained in:
commit
4856b6782a
|
@ -341,6 +341,14 @@ Node* SceneReader::createObject(const rapidjson::Value &dict, cocos2d::Node* par
|
|||
createObject(subDict, gb, attachComponent);
|
||||
}
|
||||
|
||||
const rapidjson::Value &canvasSizeDict = DICTOOL->getSubDictionary_json(dict, "CanvasSize");
|
||||
if (DICTOOL->checkObjectExist_json(canvasSizeDict))
|
||||
{
|
||||
int width = DICTOOL->getIntValue_json(canvasSizeDict, "_width");
|
||||
int height = DICTOOL->getIntValue_json(canvasSizeDict, "_height");
|
||||
gb->setContentSize(Size(width, height));
|
||||
}
|
||||
|
||||
return gb;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue