demos/bp/public/editor-compiled.js
// given pixel x,y returns unrounded tile x,y. This is useful for cut and glue
given pixel x,y returns unrounded tile x,y. This is useful for cut and glue
given pixel x y returns unrounded tile x y . This is useful for cut and glue
screenToWorldRaw(px, py) {
    if (px == null) return {tx:null, ty:null};
    px += Math.floor(this.scrollX * this.size);
    py += Math.floor(this.scrollY * this.size);
    return {
      tx: px / this.size,
      ty: py / this.size
    }
  }
screenToWorldRaw ( px , py ) { if ( px == null ) return { tx : null , ty : null } ; px += Math . floor ( this . scrollX * this . size ) ; py += Math . floor ( this . scrollY * this . size ) ; return { tx : px / this . size , ty : py / this . size } }
given pixel x,y returns unrounded tile x,y.
given pixel x y returns unrounded tile x y .
// first, the top-left pixel of the screen is at |_ scroll * size _| px from origin // now we can simply divide and floor to find the tile