diff options
author | hwc487 | 2012-04-26 16:40:05 -0700 |
---|---|---|
committer | hwc487 | 2012-04-26 16:40:05 -0700 |
commit | 5a1965bf2ed9a54601ca16fd67555335c510ce08 (patch) | |
tree | 7fa2419c8a194e7b0265b58f0f4d10d02a0d66f4 /js/lib/rdge/materials/linear-gradient-material.js | |
parent | ee07f71e9e6c9219e02738c77fb038bece2e03b6 (diff) | |
download | ninja-5a1965bf2ed9a54601ca16fd67555335c510ce08.tar.gz |
Update materials to the new texture model.
Create local world for deleted source canvases
Diffstat (limited to 'js/lib/rdge/materials/linear-gradient-material.js')
-rwxr-xr-x | js/lib/rdge/materials/linear-gradient-material.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/js/lib/rdge/materials/linear-gradient-material.js b/js/lib/rdge/materials/linear-gradient-material.js index 51a7430c..2d8e6ca7 100755 --- a/js/lib/rdge/materials/linear-gradient-material.js +++ b/js/lib/rdge/materials/linear-gradient-material.js | |||
@@ -200,7 +200,23 @@ var LinearGradientMaterial = function LinearGradientMaterial() { | |||
200 | // Methods | 200 | // Methods |
201 | /////////////////////////////////////////////////////////////////////// | 201 | /////////////////////////////////////////////////////////////////////// |
202 | // duplcate method requirde | 202 | // duplcate method requirde |
203 | this.dup = function () { return new LinearGradientMaterial(); }; | 203 | this.dup = function () |
204 | { | ||
205 | // get the current values; | ||
206 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | ||
207 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | ||
208 | |||
209 | // allocate a new material | ||
210 | var newMat = new LinearGradientMaterial(); | ||
211 | |||
212 | // copy over the current values; | ||
213 | var n = propNames.length; | ||
214 | for (var i = 0; i < n; i++) | ||
215 | newMat.setProperty(propNames[i], propValues[i]); | ||
216 | |||
217 | return newMat; | ||
218 | } | ||
219 | |||
204 | 220 | ||
205 | this.init = function (world) { | 221 | this.init = function (world) { |
206 | this.setWorld(world); | 222 | this.setWorld(world); |