Page 1 of 1

how to scale up a whole window

Posted: Sun Sep 04, 2016 8:47 am
by leNoah
Hi,
I've been working on a game with a pixelated style (cliche much?) And at the moment the game window is 150 by 100 px. Is there a way to scale up the whole window at once to, say, 600 by 400? I've seen the scale factor properties in drawings but how would I scale it up altogether, if possible?

Thanks in advance, noah :awesome:

Re: how to scale up a whole window

Posted: Sun Sep 04, 2016 8:51 am
by bartbes
The easiest way is to call [wiki]love.graphics.scale[/wiki] at the start of love.draw. You just have to be careful with using Canvases, since if you don't reset or counteract the scaling they'd be scaled twice.

Re: how to scale up a whole window

Posted: Sun Sep 04, 2016 11:21 am
by Daniel Eakins
Markgo's Screen Scaler Helper is a ready-made solution for that. It handles the scaling and coordinates automatically based on your monitor settings and keeps a correct aspect ratio so that the graphics don't look distorted or uneven.

Some of the graphics generated with love.graphics won't be scaled though, so you need to modify his script a bit if you actually notice it (for example, by using a canvas).

Ulydev also made an alternate module, which correctly scales everything using a canvas, but his version has fewer options and is a bit buggy; it requires some testing. For example, it doesn't round the scale factors, so the pixels can be uneven depending on your monitor resolution.