VirtualSky
VirtualSky copied to clipboard
Resolution is not good
Please how i can increase the resolution of the map. Currently this is not good .
you can pass a height
param
@devnedra Could you add more detail to try to explain?
@slowe I think, @devnedra meant the resolution on »retina« displays. You could increase it by dynamically reading the devicePixelRatio
, e.g.:
w = window.innerWidth;
h = window.innerHeight;
this.canvas.width = w*window.devicePixelRatio;
this.canvas.height = h*window.devicePixelRatio;
this.canvas.css({'width':w+'px','height':h+'px'});
In this case, you also need to scale the canvas element up:
ctx.scale(window.devicePixelRatio,window.devicePixelRatio);
You need to modify createSky
, setWH
, and resize
.
I made a quick test on my device (pixel ratio: 2) and it seemed fine to me (but I am not really into the edge cases of your script).