Allow more control over scaling factor
Currently PuzzleScript will always attempt to scale the game so that all the pixels are zoomed into a rounded factor. However, on games with big sprites on small screens (e.g. mobile) this might not always be what you want, and the zooming factor needs to have more intervals, even if the tradeoff is that the pixels won't be sharp.
Introduce a prelude flag to set this, and determine how to best explain/document it for developers.
Hmm, it seems like it would be an easy change, but it isn't because of many code being written for pixel perfect ratios. Each time I attempt to do it, it'll look ugly.
I thought a good first step would be to change resizing so that sprites are not regenerated when the size changes, and are always on 1:1 scale on the sheet. However, pixel perfect scaling of images is not something that most browsers support, meaning you have little control over the scaling algorithm.
Moving back to the backlog.
However, pixel perfect scaling of images is not something that most browsers support, meaning you have little control over the scaling algorithm
I don't think that's correct; I believe something like this should do it:
canvas {
image-rendering:-moz-crisp-edges;
image-rendering:pixelated;
}
or in javascript:
const ctx = mycanvas.getContext('2d')
ctx.imageSmoothingEnabled = false
It seems to me that a prelude flag that applies imageSmoothingEnabled in javascript and also allows non-integer-scale resolutions should be doable!
(Sorry for the late reply) I think I stumbled across https://greggman.github.io/pixel-perfect.js/#details and based on that decided it wouldn't be easy to get to work. But I should probably have another look
oh geez, just reading that page gives me a headache. sounds like they know more about the css way than I do. but I would hope that imageSmoothingEnabled=false would work :crossed_fingers: