aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/document/html-document.js4
-rw-r--r--js/io/system/ninjalibrary.json2
-rwxr-xr-xjs/lib/rdge/materials/linear-gradient-material.js24
3 files changed, 24 insertions, 6 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 9d083dd8..61223499 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -209,8 +209,8 @@ exports.HTMLDocument = Montage.create(TextDocument, {
209 { 209 {
210 /* 210 /*
211 // Use this code to test the runtime version of WebGL 211 // Use this code to test the runtime version of WebGL
212 var cdm = new NinjaCvsRt.CanvasDataManager(); 212 var cvsDataMngr = Object.create(NinjaCvsRt.CanvasDataManager, {});
213 cdm.loadGLData(elt, value, null ); 213 cvsDataMngr.loadGLData(elt, value);
214 */ 214 */
215 215
216 // /* 216 // /*
diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json
index feced079..5bacb28a 100644
--- a/js/io/system/ninjalibrary.json
+++ b/js/io/system/ninjalibrary.json
@@ -1,6 +1,6 @@
1{ 1{
2 "libraries": [ 2 "libraries": [
3 {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.8.0.0"}, 3 {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.8.0.0"},
4 {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.6.0"} 4 {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.6.1"}
5 ] 5 ]
6} \ No newline at end of file 6} \ No newline at end of file
diff --git a/js/lib/rdge/materials/linear-gradient-material.js b/js/lib/rdge/materials/linear-gradient-material.js
index 79f323db..9b331fa7 100755
--- a/js/lib/rdge/materials/linear-gradient-material.js
+++ b/js/lib/rdge/materials/linear-gradient-material.js
@@ -26,6 +26,8 @@ var LinearGradientMaterial = function LinearGradientMaterial() {
26 // this._colorCount = 4; 26 // this._colorCount = 4;
27 this._angle = 0.0; // the shader takes [cos(a), sin(a)] 27 this._angle = 0.0; // the shader takes [cos(a), sin(a)]
28 28
29 this._textureTransform = [1,0,0, 0,1,0, 0,0,1];
30
29 /////////////////////////////////////////////////////////////////////// 31 ///////////////////////////////////////////////////////////////////////
30 // Property Accessors 32 // Property Accessors
31 /////////////////////////////////////////////////////////////////////// 33 ///////////////////////////////////////////////////////////////////////
@@ -195,7 +197,21 @@ var LinearGradientMaterial = function LinearGradientMaterial() {
195 // Methods 197 // Methods
196 /////////////////////////////////////////////////////////////////////// 198 ///////////////////////////////////////////////////////////////////////
197 // duplcate method requirde 199 // duplcate method requirde
198 this.dup = function () { return new LinearGradientMaterial(); }; 200 this.dup = function () {
201 // allocate a new material
202 var newMat = new LinearGradientMaterial();
203
204 // copy over the current values;
205 var propNames = [], propValues = [], propTypes = [], propLabels = [];
206 this.getAllProperties( propNames, propValues, propTypes, propLabels);
207 var n = propNames.length;
208 for (var i=0; i<n; i++) {
209 newMat.setProperty( propNames[i], propValues[i] );
210 }
211 newMat._textureTransform = this._textureTransform.slice();
212
213 return newMat;
214 };
199 215
200 this.init = function (world) { 216 this.init = function (world) {
201 this.setWorld(world); 217 this.setWorld(world);
@@ -241,7 +257,7 @@ var LinearGradientMaterial = function LinearGradientMaterial() {
241 257
242 this.setAngle(this.getAngle()); 258 this.setAngle(this.getAngle());
243 259
244 this._shader['default'].u_texTransform.set( [1,0,0, 0,1,0, 0,0,1] ); 260 this._shader['default'].u_texTransform.set( this._textureTransform );
245 } 261 }
246 }; 262 };
247 263
@@ -258,7 +274,8 @@ var LinearGradientMaterial = function LinearGradientMaterial() {
258 'colorStop2': this.getColorStop2(), 274 'colorStop2': this.getColorStop2(),
259 'colorStop3': this.getColorStop3(), 275 'colorStop3': this.getColorStop3(),
260 'colorStop4': this.getColorStop4(), 276 'colorStop4': this.getColorStop4(),
261 'angle': this.getAngle() 277 'angle': this.getAngle(),
278 'textureTransform': this._textureTransform
262 }; 279 };
263 280
264 return jObj; 281 return jObj;
@@ -278,6 +295,7 @@ var LinearGradientMaterial = function LinearGradientMaterial() {
278 colorStop3 = jObj.colorStop3, 295 colorStop3 = jObj.colorStop3,
279 colorStop4 = jObj.colorStop4, 296 colorStop4 = jObj.colorStop4,
280 angle = jObj.angle; 297 angle = jObj.angle;
298 this._textureTransform = jObj.textureTransform;
281 299
282 this.setProperty("color1", color1); 300 this.setProperty("color1", color1);
283 this.setProperty("color2", color2); 301 this.setProperty("color2", color2);