code: function( options ){
  
              var self = this;
  
              // call proto init
              proto.init.call(this, options);
  
              // further options
              this.options.defaults( defaults, true );
              this.options.onChange(function(){
                  self.options.offset = new Physics.vector( self.options.offset );
              });
              this.options( options, true );
  
              // hidden canvas
              this.hiddenCanvas = document.createElement('canvas');
              this.hiddenCanvas.width = this.hiddenCanvas.height = 100;
  
              if (!this.hiddenCanvas.getContext){
                  throw "Canvas not supported";
              }
  
              this.hiddenCtx = this.hiddenCanvas.getContext('2d');
  
              // actual viewport
              var viewport = this.el;
              if (viewport.nodeName.toUpperCase() !== 'CANVAS'){
  
                  viewport = document.createElement('canvas');
                  this.el.appendChild( viewport );
                  if (typeof this.options.el === 'string' && this.el === document.body){
                      viewport.id = this.options.el;
                  }
                  this.el = viewport;
              }
  
              this.container = this.el.parentNode;
              this.ctx = viewport.getContext('2d');
  
              this.els = {};
  
              if (this.options.meta){
                  var stats = this.options.metaEl || newEl();
                  stats.className = 'pjs-meta';
                  this.els.fps = newEl('span');
                  this.els.ipf = newEl('span');
                  stats.appendChild(newEl('span', 'fps: '));
                  stats.appendChild(this.els.fps);
                  stats.appendChild(newEl('br'));
                  stats.appendChild(newEl('span', 'ipf: '));
                  stats.appendChild(this.els.ipf);
  
                  viewport.parentNode.insertBefore(stats, viewport);
              }
  
              this._layers = {};
              this.addLayer( 'main', this.el );
  
              if ( this.options.autoResize ){
                  this.resize();
              } else {
                  this.resize( this.options.width, this.options.height );
              }
          }
docs: extended