diff options
author | hwc487 | 2012-03-22 15:47:11 -0700 |
---|---|---|
committer | hwc487 | 2012-03-22 15:47:11 -0700 |
commit | e927e4702d7dbd4a878f6979b3f56b46758f93de (patch) | |
tree | e6bb8951374a6504bd6c745ce7233da5cd4869dc /js/lib/rdge/materials/flat-material.js | |
parent | 00cd98e49c959906d7c44bb6adcdef1f3d5148ae (diff) | |
parent | 31e924e1b8b8da8342b3ff2341c8284915486c0b (diff) | |
download | ninja-e927e4702d7dbd4a878f6979b3f56b46758f93de.tar.gz |
Merge branch 'integration' of github.com:ericmueller/ninja-internal into Textures
Diffstat (limited to 'js/lib/rdge/materials/flat-material.js')
-rwxr-xr-x | js/lib/rdge/materials/flat-material.js | 21 |
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 | }; |