Merge pull request #13194 from VisualSJ/v3-boneTest

[ci skip] Update JSON parser
This commit is contained in:
pandamicro 2015-08-04 15:35:27 +08:00
commit 744fa0b565
2 changed files with 4 additions and 6 deletions

View File

@ -113,7 +113,7 @@
name: "Rotation",
handle: function(options){
var frame = new ccs.RotationFrame();
var rotation = options["Rotation"];
var rotation = options["Rotation"] || options["Value"] || 0;
frame.setRotation(rotation);
return frame;
}

View File

@ -104,7 +104,9 @@
var visible = getParam(json["VisibleForFrame"], true);
node.setVisible(visible);
setContentSize(node, json["Size"]);
var size = json["Size"];
if(size)
setContentSize(node, size);
if (json["Alpha"] != null)
node.setOpacity(json["Alpha"]);
@ -118,9 +120,7 @@
extensionData.setCustomProperty(customProperty);
extensionData.setActionTag(actionTag);
if (node.getComponent("ComExtensionData"))
{
node.removeComponent("ComExtensionData");
}
node.addComponent(extensionData);
node.setCascadeColorEnabled(true);
@ -294,9 +294,7 @@
extensionData.setCustomProperty(customProperty);
extensionData.setActionTag(actionTag);
if (widget.getComponent("ComExtensionData"))
{
widget.removeComponent("ComExtensionData");
}
widget.addComponent(extensionData);
var rotationSkewX = json["RotationSkewX"];