src/level/tiled/TMXTileset.js
function (renderer, dx, dy, tmxTile) {

            // check if any transformation is required
            if (tmxTile.flipped) {
                renderer.save();
                // apply the tile current transform
                renderer.translate(dx, dy);
                renderer.transform(tmxTile.currentTransform);
                // reset both values as managed through transform();
                dx = dy = 0;
            }

            // check if the tile has an associated image
            if (this.isCollection === true) {
                // draw the tile
                renderer.drawImage(
                    this.imageCollection[tmxTile.tileId],
                    0, 0,
                    tmxTile.width, tmxTile.height,
                    dx, dy,
                    tmxTile.width, tmxTile.height
                );
            } else {
                // use the tileset texture
                var offset = this.atlas[this.getViewTileId(tmxTile.tileId)].offset;
                // draw the tile
                renderer.drawImage(
                    this.image,
                    offset.x, offset.y,
                    this.tilewidth, this.tileheight,
                    dx, dy,
                    this.tilewidth + renderer.uvOffset, this.tileheight + renderer.uvOffset
                );
            }

            if (tmxTile.flipped)  {
                // restore the context to the previous state
                renderer.restore();
            }
        }
function (renderer, dx, dy, tmxTile) {

            // check if any transformation is required
            if (tmxTile.flipped) {
                renderer.save();
                // apply the tile current transform
                renderer.translate(dx, dy);
                renderer.transform(tmxTile.currentTransform);
                // reset both values as managed through transform();
                dx = dy = 0;
            }

            // check if the tile has an associated image
            if (this.isCollection === true) {
                // draw the tile
                renderer.drawImage(
                    this.imageCollection[tmxTile.tileId],
                    0, 0,
                    tmxTile.width, tmxTile.height,
                    dx, dy,
                    tmxTile.width, tmxTile.height
                );
            } else {
                // use the tileset texture
                var offset = this.atlas[this.getViewTileId(tmxTile.tileId)].offset;
                // draw the tile
                renderer.drawImage(
                    this.image,
                    offset.x, offset.y,
                    this.tilewidth, this.tileheight,
                    dx, dy,
                    this.tilewidth + renderer.uvOffset, this.tileheight + renderer.uvOffset
                );
            }

            if (tmxTile.flipped)  {
                // restore the context to the previous state
                renderer.restore();
            }
        }
function ( renderer , dx , dy , tmxTile ) { // check if any transformation is required if ( tmxTile . flipped ) { renderer . save ( ) ; // apply the tile current transform renderer . translate ( dx , dy ) ; renderer . transform ( tmxTile . currentTransform ) ; // reset both values as managed through transform(); dx = dy = 0 ; } // check if the tile has an associated image if ( this . isCollection === true ) { // draw the tile renderer . drawImage ( this . imageCollection [ tmxTile . tileId ] , 0 , 0 , tmxTile . width , tmxTile . height , dx , dy , tmxTile . width , tmxTile . height ) ; } else { // use the tileset texture var offset = this . atlas [ this . getViewTileId ( tmxTile . tileId ) ] . offset ; // draw the tile renderer . drawImage ( this . image , offset . x , offset . y , this . tilewidth , this . tileheight , dx , dy , this . tilewidth + renderer . uvOffset , this . tileheight + renderer . uvOffset ) ; } if ( tmxTile . flipped ) { // restore the context to the previous state renderer . restore ( ) ; } }
draw the x,y tile
draw the x y tile