From 2ab7fbef0df37f0c2bb6a4447f03993b9d50b5d0 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 29 Mar 2012 07:27:49 -0700 Subject: linked textures --- js/lib/rdge/texture.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'js/lib/rdge') diff --git a/js/lib/rdge/texture.js b/js/lib/rdge/texture.js index 41c9a54a..d67c65d2 100644 --- a/js/lib/rdge/texture.js +++ b/js/lib/rdge/texture.js @@ -68,6 +68,9 @@ function Texture( dstWorld, texMapName, wrap, mips ) { this._srcWorld = srcCanvas.elementModel.shapeModel.GLWorld; + // add a notifier to the world + this._srcWorld.addListener( this, this.worldCallback, { myObj: 'anything' } ); + // check if the source is animated if (srcCanvas.elementModel && srcCanvas.elementModel.shapeModel && srcCanvas.elementModel.shapeModel.GLWorld) this._isAnimated = this._srcWorld._hasAnimatedMaterials; @@ -79,8 +82,11 @@ function Texture( dstWorld, texMapName, wrap, mips ) { this.loadFromFile(); } + } - + this.worldCallback = function( type, callbackObj, calleeData, callerData ) + { + console.log( "texture callback, type: " + type ); } this.loadFromFile = function() -- cgit v1.2.3