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.
Scäle library is finished
Re: Scäle library is finished
Nice idea, i'm thinking about the same, but using love.graphics.translate.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Scäle library is finished
love.graphics.scale works on text and images alike.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.
Help us help you: attach a .love.
Re: Scäle library is finished
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?Robin wrote:love.graphics.scale works on text and images alike.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.
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Scäle library is finished
That sounds very similar to what I did for my plant game, except it operates on a 0-1 scale for x and y.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Who is online
Users browsing this forum: No registered users and 2 guests