From 9321b1d7ab2d23e165ac90e9eea3287f72463948 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 17 May 2012 09:51:11 -0700 Subject: Linear & radial gradients for runtime fixes --- js/document/html-document.js | 4 ++-- js/io/system/ninjalibrary.json | 2 +- js/lib/rdge/materials/linear-gradient-material.js | 24 ++++++++++++++++++++--- 3 files changed, 24 insertions(+), 6 deletions(-) (limited to 'js') 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, { { /* // Use this code to test the runtime version of WebGL - var cdm = new NinjaCvsRt.CanvasDataManager(); - cdm.loadGLData(elt, value, null ); + var cvsDataMngr = Object.create(NinjaCvsRt.CanvasDataManager, {}); + cvsDataMngr.loadGLData(elt, value); */ // /* 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 @@ { "libraries": [ {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.8.0.0"}, - {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.6.0"} + {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.6.1"} ] } \ 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() { // this._colorCount = 4; this._angle = 0.0; // the shader takes [cos(a), sin(a)] + this._textureTransform = [1,0,0, 0,1,0, 0,0,1]; + /////////////////////////////////////////////////////////////////////// // Property Accessors /////////////////////////////////////////////////////////////////////// @@ -195,7 +197,21 @@ var LinearGradientMaterial = function LinearGradientMaterial() { // Methods /////////////////////////////////////////////////////////////////////// // duplcate method requirde - this.dup = function () { return new LinearGradientMaterial(); }; + this.dup = function () { + // allocate a new material + var newMat = new LinearGradientMaterial(); + + // copy over the current values; + var propNames = [], propValues = [], propTypes = [], propLabels = []; + this.getAllProperties( propNames, propValues, propTypes, propLabels); + var n = propNames.length; + for (var i=0; i