dist/melonjs.js
function getRenderable(settings) {
         var renderable;
         var tileset = this.tileset;

         if (tileset.animations.has(this.tileId)) {
           var frames = [];
           var frameId = [];
           tileset.animations.get(this.tileId).frames.forEach(function (frame) {
             frameId.push(frame.tileid);
             frames.push({
               name: "" + frame.tileid,
               delay: frame.duration
             });
           });
           renderable = tileset.texture.createAnimationFromName(frameId, settings);
           renderable.addAnimation(this.tileId - tileset.firstgid, frames);
           renderable.setCurrentAnimation(this.tileId - tileset.firstgid);
         } else {
           if (tileset.isCollection === true) {
             var image = tileset.getTileImage(this.tileId);
             renderable = new me.Sprite(0, 0, Object.assign({
               image: image
             }) //, settings)
             );
             renderable.anchorPoint.set(0, 0);
             renderable.scale(settings.width / this.width, settings.height / this.height);

             if (typeof settings.rotation !== "undefined") {
               renderable.anchorPoint.set(0.5, 0.5);
               renderable.currentTransform.rotate(settings.rotation);
               renderable.currentTransform.translate(settings.width / 2, settings.height / 2); // TODO : move the rotation related code from TMXTiledMap to here (under)

               settings.rotation = undefined;
             }
           } else {
             renderable = tileset.texture.createSpriteFromName(this.tileId - tileset.firstgid, settings);
           }
         } // any H/V flipping to apply?


         if (this.flippedX) {
           renderable.currentTransform.scaleX(-1);
         }

         if (this.flippedY) {
           renderable.currentTransform.scaleY(-1);
         }

         return renderable;
       }
function getRenderable(settings) {
         var renderable;
         var tileset = this.tileset;

         if (tileset.animations.has(this.tileId)) {
           var frames = [];
           var frameId = [];
           tileset.animations.get(this.tileId).frames.forEach(function (frame) {
             frameId.push(frame.tileid);
             frames.push({
               name: "" + frame.tileid,
               delay: frame.duration
             });
           });
           renderable = tileset.texture.createAnimationFromName(frameId, settings);
           renderable.addAnimation(this.tileId - tileset.firstgid, frames);
           renderable.setCurrentAnimation(this.tileId - tileset.firstgid);
         } else {
           if (tileset.isCollection === true) {
             var image = tileset.getTileImage(this.tileId);
             renderable = new me.Sprite(0, 0, Object.assign({
               image: image
             }) //, settings)
             );
             renderable.anchorPoint.set(0, 0);
             renderable.scale(settings.width / this.width, settings.height / this.height);

             if (typeof settings.rotation !== "undefined") {
               renderable.anchorPoint.set(0.5, 0.5);
               renderable.currentTransform.rotate(settings.rotation);
               renderable.currentTransform.translate(settings.width / 2, settings.height / 2); // TODO : move the rotation related code from TMXTiledMap to here (under)

               settings.rotation = undefined;
             }
           } else {
             renderable = tileset.texture.createSpriteFromName(this.tileId - tileset.firstgid, settings);
           }
         } // any H/V flipping to apply?


         if (this.flippedX) {
           renderable.currentTransform.scaleX(-1);
         }

         if (this.flippedY) {
           renderable.currentTransform.scaleY(-1);
         }

         return renderable;
       }
function getRenderable ( settings ) { var renderable ; var tileset = this . tileset ; if ( tileset . animations . has ( this . tileId ) ) { var frames = [ ] ; var frameId = [ ] ; tileset . animations . get ( this . tileId ) . frames . forEach ( function ( frame ) { frameId . push ( frame . tileid ) ; frames . push ( { name : "" + frame . tileid , delay : frame . duration } ) ; } ) ; renderable = tileset . texture . createAnimationFromName ( frameId , settings ) ; renderable . addAnimation ( this . tileId - tileset . firstgid , frames ) ; renderable . setCurrentAnimation ( this . tileId - tileset . firstgid ) ; } else { if ( tileset . isCollection === true ) { var image = tileset . getTileImage ( this . tileId ) ; renderable = new me . Sprite ( 0 , 0 , Object . assign ( { image : image } ) //, settings) ) ; renderable . anchorPoint . set ( 0 , 0 ) ; renderable . scale ( settings . width / this . width , settings . height / this . height ) ; if ( typeof settings . rotation !== "undefined" ) { renderable . anchorPoint . set ( 0.5 , 0.5 ) ; renderable . currentTransform . rotate ( settings . rotation ) ; renderable . currentTransform . translate ( settings . width / 2 , settings . height / 2 ) ; // TODO : move the rotation related code from TMXTiledMap to here (under) settings . rotation = undefined ; } } else { renderable = tileset . texture . createSpriteFromName ( this . tileId - tileset . firstgid , settings ) ; } } // any H/V flipping to apply? if ( this . flippedX ) { renderable . currentTransform . scaleX ( - 1 ) ; } if ( this . flippedY ) { renderable . currentTransform . scaleY ( - 1 ) ; } return renderable ; }
return a renderable object for this Tile object
@name me.Tile#getRenderable
@public
@function
@param {Object} [settings] see {@link me.Sprite}
@return {me.Renderable} a me.Sprite object
return a renderable object for this Tile object