diff options
author | hwc487 | 2012-03-21 16:51:05 -0700 |
---|---|---|
committer | hwc487 | 2012-03-21 16:51:05 -0700 |
commit | 4cd4d29ae10b87f7b280d537b8980d207a22dd43 (patch) | |
tree | afd4af73481a50d7e96b9a5e00300c0960e07023 | |
parent | c919442392a9406aeca6764f67e4875ee0a6370a (diff) | |
download | ninja-4cd4d29ae10b87f7b280d537b8980d207a22dd43.tar.gz |
Synchronized material animation speed for pulse material between Ninja and runtime.
-rw-r--r-- | assets/canvas-runtime.js | 7 | ||||
-rw-r--r-- | js/lib/rdge/materials/pulse-material.js | 5 |
2 files changed, 11 insertions, 1 deletions
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() | |||
1249 | this.import = function( jObj ) | 1249 | this.import = function( jObj ) |
1250 | { | 1250 | { |
1251 | this._texMap = jObj.texture; | 1251 | this._texMap = jObj.texture; |
1252 | if (jObj.dTime) this._dTime = jObj.dTime; | ||
1252 | } | 1253 | } |
1253 | 1254 | ||
1254 | this.init = function( world ) | 1255 | this.init = function( world ) |
@@ -1603,6 +1604,12 @@ function RuntimePlasmaMaterial() | |||
1603 | this.update(); | 1604 | this.update(); |
1604 | } | 1605 | } |
1605 | 1606 | ||
1607 | this.importJSON = function( jObj ) | ||
1608 | { | ||
1609 | this._speed = jObj.speed; | ||
1610 | this._dTime = jObj.dTime; | ||
1611 | } | ||
1612 | |||
1606 | this.update = function( time ) | 1613 | this.update = function( time ) |
1607 | { | 1614 | { |
1608 | var material = this._materialNode; | 1615 | 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() { | |||
169 | { | 169 | { |
170 | 'material' : this.getShaderName(), | 170 | 'material' : this.getShaderName(), |
171 | 'name' : this.getName(), | 171 | 'name' : this.getName(), |
172 | 'texture' : this._propValues[this._propNames[0]] | 172 | 'texture' : this._propValues[this._propNames[0]], |
173 | 'dTime' : this._dTime | ||
173 | }; | 174 | }; |
174 | 175 | ||
175 | return jObj; | 176 | return jObj; |
@@ -183,6 +184,8 @@ var PulseMaterial = function PulseMaterial() { | |||
183 | try { | 184 | try { |
184 | this._propValues[this._propNames[0]] = jObj.texture; | 185 | this._propValues[this._propNames[0]] = jObj.texture; |
185 | this._texMap = jObj.texture; | 186 | this._texMap = jObj.texture; |
187 | if (jObj.dTime) | ||
188 | this._dTime = jObj.dTime; | ||
186 | } | 189 | } |
187 | catch (e) | 190 | catch (e) |
188 | { | 191 | { |