SampleProvider / Meadow-Guarder-old2

A free browser RPG game.
http://meadowguarder.herokuapp.com/
Other
16 stars 7 forks source link

Aliasing issues with items #362

Open spsquared opened 2 years ago

spsquared commented 2 years ago

image Items or anything at an angle will appear horribly aliased and interpolated. The canvas is not scaled correctly in relation to some screens (like mine)

A very simple solution is to simply scale the canvas by the device pixel ratio (dpr):

DPR = 1;
if (window.devicePixelRatio) {
    DPR = window.devicePixelRatio;
}
CTX.width = window.innerWidth*DPR;
CTX.height = window.innerHeight*DPR;
CTX.scale(DPR, DPR);

This will fix all interpolation issues except for things being drawn at floating-point locations. Also, it scales the canvas correctly to fit the screen.

spsquared commented 2 years ago

image image Items in Mountain Guarder

erikji commented 2 years ago

also fix layers

spsquared commented 2 years ago

also fix layers

That's not related to this issue. Please create a new issue for this issue.

erikji commented 2 years ago

it is tho

erikji commented 2 years ago

i dont have the energy to create another issue atm so