From 4cd4d29ae10b87f7b280d537b8980d207a22dd43 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 21 Mar 2012 16:51:05 -0700 Subject: Synchronized material animation speed for pulse material between Ninja and runtime. --- assets/canvas-runtime.js | 7 +++++++ js/lib/rdge/materials/pulse-material.js | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js index 87aac71f..7f2dc8ab 100644 --- a/assets/canvas-runtime.js +++ b/assets/canvas-runtime.js @@ -1249,6 +1249,7 @@ function RuntimePulseMaterial() this.import = function( jObj ) { this._texMap = jObj.texture; + if (jObj.dTime) this._dTime = jObj.dTime; } this.init = function( world ) @@ -1603,6 +1604,12 @@ function RuntimePlasmaMaterial() this.update(); } + this.importJSON = function( jObj ) + { + this._speed = jObj.speed; + this._dTime = jObj.dTime; + } + this.update = function( time ) { var material = this._materialNode; diff --git a/js/lib/rdge/materials/pulse-material.js b/js/lib/rdge/materials/pulse-material.js index e6be69b4..2075d1ff 100644 --- a/js/lib/rdge/materials/pulse-material.js +++ b/js/lib/rdge/materials/pulse-material.js @@ -169,7 +169,8 @@ var PulseMaterial = function PulseMaterial() { { 'material' : this.getShaderName(), 'name' : this.getName(), - 'texture' : this._propValues[this._propNames[0]] + 'texture' : this._propValues[this._propNames[0]], + 'dTime' : this._dTime }; return jObj; @@ -183,6 +184,8 @@ var PulseMaterial = function PulseMaterial() { try { this._propValues[this._propNames[0]] = jObj.texture; this._texMap = jObj.texture; + if (jObj.dTime) + this._dTime = jObj.dTime; } catch (e) { -- cgit v1.2.3