Page 1 of 1

Scäle library is finished

Posted: Sun Mar 13, 2011 10:51 pm
by Tesselode
I made a topic about this a while ago, but it's pretty useless. I decided to finish the library, and it turns out there wasn't much left to do.

Scäle is a library that replaces the love.graphics functions with functions that keep the correct aspect ratio of the graphics no matter what the resolution is. Objects are the same distance from the center of the screen no matter what the horizontal resolution is, and they zoom in or out based on vertical resolution. This is useful for allowing games to run in multiple (and widescreen) resolutions.

To use this library, replace love.graphics functions with Scäle's counterparts and place everything where you would want it on an 800x600 window. Currently scale_circle, scale_rectangle, scale_draw, scale_line, scale_point, scale_polygon, and scale_triangle are included.

Download it here: http://tesselode.110mb.com/files/love/scale.lua

If anyone has an idea of how to scale fonts, please let me know. Also, if anyone can format the code so that everything is spaced out nicely, that would be nice too.

Re: Scäle library is finished

Posted: Mon Mar 14, 2011 4:45 am
by RPG
Nice idea, i'm thinking about the same, but using love.graphics.translate.

Re: Scäle library is finished

Posted: Mon Mar 14, 2011 10:27 am
by Robin
Tesselode wrote:If anyone has an idea of how to scale fonts, please let me know. Also, if anyone can format the code so that everything is spaced out nicely, that would be nice too.
love.graphics.scale works on text and images alike.

Re: Scäle library is finished

Posted: Mon Mar 14, 2011 10:17 pm
by Tesselode
Robin wrote:
Tesselode wrote:If anyone has an idea of how to scale fonts, please let me know. Also, if anyone can format the code so that everything is spaced out nicely, that would be nice too.
love.graphics.scale works on text and images alike.
It makes things kind of blurry, though. If you take a high-resolution image, draw it at a smaller size, and use love.graphics.scale, does it stay high-resolution?

Re: Scäle library is finished

Posted: Tue Mar 15, 2011 1:31 am
by Taehl
That sounds very similar to what I did for my plant game, except it operates on a 0-1 scale for x and y.