aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/linear-gradient-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/linear-gradient-material.js')
-rwxr-xr-xjs/lib/rdge/materials/linear-gradient-material.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/lib/rdge/materials/linear-gradient-material.js b/js/lib/rdge/materials/linear-gradient-material.js
index 7e53db84..f5c54726 100755
--- a/js/lib/rdge/materials/linear-gradient-material.js
+++ b/js/lib/rdge/materials/linear-gradient-material.js
@@ -79,6 +79,25 @@ var LinearGradientMaterial = function LinearGradientMaterial() {
79 this.setShaderValues(); 79 this.setShaderValues();
80 this.update( 0 ); 80 this.update( 0 );
81 }; 81 };
82
83 this.resetToDefault = function()
84 {
85 this._propValues[this._propNames[0]] = this._color1.slice(0);
86 this._propValues[this._propNames[1]] = this._color2.slice(0);
87 this._propValues[this._propNames[2]] = this._color3.slice(0);
88 this._propValues[this._propNames[3]] = this._color4.slice(0);
89
90 this._propValues[this._propNames[4]] = this._colorStop1;
91 this._propValues[this._propNames[5]] = this._colorStop2;
92 this._propValues[this._propNames[6]] = this._colorStop3;
93 this._propValues[this._propNames[7]] = this._colorStop4;
94
95 this._propValues[this._propNames[8]] = [ Math.cos(this._angle), Math.sin(this._angle) ];
96
97 var nProps = this._propNames.length;
98 for (var i=0; i<nProps; i++)
99 this.setProperty( this._propNames[i], this._propValues[this._propNames[i]] );
100 };
82}; 101};
83 102
84/////////////////////////////////////////////////////////////////////////////////////// 103///////////////////////////////////////////////////////////////////////////////////////