aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/flat-material.js
diff options
context:
space:
mode:
authorEric Guzman2012-03-27 10:22:42 -0700
committerEric Guzman2012-03-27 10:22:42 -0700
commit309b201017da2a4094df4f06adeeff9d396b193a (patch)
tree92257b32855bcd31dd74967b085a6632fd7dbe9b /js/lib/rdge/materials/flat-material.js
parentda03585a0b03220281f6d54d9acf0ae0fafaef16 (diff)
parent309dde5a8c4599cef6a1052c1ff9ee1ad8ec5858 (diff)
downloadninja-309b201017da2a4094df4f06adeeff9d396b193a.tar.gz
Merge branch 'refs/heads/master' into PresetsPI
Diffstat (limited to 'js/lib/rdge/materials/flat-material.js')
-rwxr-xr-xjs/lib/rdge/materials/flat-material.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/lib/rdge/materials/flat-material.js b/js/lib/rdge/materials/flat-material.js
index fff0e68e..5030cc88 100755
--- a/js/lib/rdge/materials/flat-material.js
+++ b/js/lib/rdge/materials/flat-material.js
@@ -112,6 +112,27 @@ var FlatMaterial = function FlatMaterial() {
112 return rtnStr; 112 return rtnStr;
113 }; 113 };
114 114
115 this.exportJSON = function()
116 {
117 var jObj =
118 {
119 'material' : this.getShaderName(),
120 'name' : this.getName(),
121 'color' : this._propValues["color"]
122 };
123
124 return jObj;
125 }
126
127 this.importJSON = function( jObj )
128 {
129 if (this.getShaderName() != jObj.material) throw new Error( "ill-formed material" );
130 this.setName( jObj.name );
131
132 var color = jObj.color;
133 this.setProperty( "color", color);
134 }
135
115 this.update = function( time ) 136 this.update = function( time )
116 { 137 {
117 }; 138 };