Merge pull request #7979 from giginet/scene-reader-canvas-size

SceneReader sets contentSize by canvasSize.
This commit is contained in:
minggo 2014-10-10 15:00:28 +08:00
commit 4856b6782a
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}