src/level/tiled/TMXLayer.js
function (renderer, rect) {
            // use the offscreen canvas
            if (this.preRender) {
                var width = Math.min(rect.width, this.width);
                var height = Math.min(rect.height, this.height);

                // draw using the cached canvas
                renderer.drawImage(
                    this.canvasRenderer.getCanvas(),
                    rect.pos.x, rect.pos.y, // sx,sy
                    width, height,          // sw,sh
                    rect.pos.x, rect.pos.y, // dx,dy
                    width, height           // dw,dh
                );
            }
            // dynamically render the layer
            else {
                // draw the layer
                this.renderer.drawTileLayer(renderer, this, rect);
            }
        }
function (renderer, rect) {
            // use the offscreen canvas
            if (this.preRender) {
                var width = Math.min(rect.width, this.width);
                var height = Math.min(rect.height, this.height);

                // draw using the cached canvas
                renderer.drawImage(
                    this.canvasRenderer.getCanvas(),
                    rect.pos.x, rect.pos.y, // sx,sy
                    width, height,          // sw,sh
                    rect.pos.x, rect.pos.y, // dx,dy
                    width, height           // dw,dh
                );
            }
            // dynamically render the layer
            else {
                // draw the layer
                this.renderer.drawTileLayer(renderer, this, rect);
            }
        }
function ( renderer , rect ) { // use the offscreen canvas if ( this . preRender ) { var width = Math . min ( rect . width , this . width ) ; var height = Math . min ( rect . height , this . height ) ; // draw using the cached canvas renderer . drawImage ( this . canvasRenderer . getCanvas ( ) , rect . pos . x , rect . pos . y , // sx,sy width , height , // sw,sh rect . pos . x , rect . pos . y , // dx,dy width , height // dw,dh ) ; } // dynamically render the layer else { // draw the layer this . renderer . drawTileLayer ( renderer , this , rect ) ; } }
draw a tileset layer
@ignore
draw a tileset layer