diff options
-rw-r--r-- | assets/canvas-runtime.js | 6 | ||||
-rwxr-xr-x | js/document/html-document.js | 4 | ||||
-rw-r--r-- | js/io/system/ninjalibrary.json | 2 | ||||
-rwxr-xr-x | js/lib/rdge/materials/linear-gradient-material.js | 24 |
4 files changed, 30 insertions, 6 deletions
diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js index eeafaab6..b6682493 100644 --- a/assets/canvas-runtime.js +++ b/assets/canvas-runtime.js | |||
@@ -1456,6 +1456,8 @@ NinjaCvsRt.RuntimeRadialGradientMaterial = Object.create(NinjaCvsRt.RuntimeMater | |||
1456 | _colorStop3: { value: 0.6, writable: true }, | 1456 | _colorStop3: { value: 0.6, writable: true }, |
1457 | _colorStop4: { value: 1.0, writable: true }, | 1457 | _colorStop4: { value: 1.0, writable: true }, |
1458 | 1458 | ||
1459 | _textureTransform: { value: [1,0,0, 0,1,0, 0,0,1], writable: true }, | ||
1460 | |||
1459 | init: { | 1461 | init: { |
1460 | value: function(world) { | 1462 | value: function(world) { |
1461 | var material = this._materialNode; | 1463 | var material = this._materialNode; |
@@ -1477,6 +1479,8 @@ NinjaCvsRt.RuntimeRadialGradientMaterial = Object.create(NinjaCvsRt.RuntimeMater | |||
1477 | this._shader["default"].u_colorStop3.set( [this._colorStop3] ); | 1479 | this._shader["default"].u_colorStop3.set( [this._colorStop3] ); |
1478 | this._shader["default"].u_colorStop4.set( [this._colorStop4] ); | 1480 | this._shader["default"].u_colorStop4.set( [this._colorStop4] ); |
1479 | 1481 | ||
1482 | this._shader["default"].u_texTransform.set( this._textureTransform ); | ||
1483 | |||
1480 | if (this._angle !== undefined) | 1484 | if (this._angle !== undefined) |
1481 | this._shader["default"].u_cos_sin_angle.set([Math.cos(this._angle), Math.sin(this._angle)]); | 1485 | this._shader["default"].u_cos_sin_angle.set([Math.cos(this._angle), Math.sin(this._angle)]); |
1482 | } | 1486 | } |
@@ -1496,6 +1500,8 @@ NinjaCvsRt.RuntimeRadialGradientMaterial = Object.create(NinjaCvsRt.RuntimeMater | |||
1496 | this._colorStop3 = jObj.colorStop3; | 1500 | this._colorStop3 = jObj.colorStop3; |
1497 | this._colorStop4 = jObj.colorStop4; | 1501 | this._colorStop4 = jObj.colorStop4; |
1498 | 1502 | ||
1503 | this._textureTransform = jObj.textureTransform; | ||
1504 | |||
1499 | if (this._angle !== undefined) | 1505 | if (this._angle !== undefined) |
1500 | this._angle = jObj.angle; | 1506 | this._angle = jObj.angle; |
1501 | } | 1507 | } |
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); |