New video showcase (i feel like new one are not really better then last one... but at least 1080p, so hurray?):
https://github.com/Vovkiv/resolution_solution
Version v2000 27 december 2022
Big rewrite! Check source file for all detailed changes. (Some functionality in this version is not compatible with old versions.)
Source file, at almost top, now include some tips and "tricks", check them out.
New:
* Pixel Perfect scaling! rs.setScaleMode(3) to check it out!
* rs.init(options) - before, to change some options in library, you could update value directly from rs.* table or use provided built-in functions. Now, considering new "insidies" of library, changing options directly as rs.scaleMode = 1 will do nothing, because library will be updated only on rs.resize() or via newly (and old one) provided functions, including rs.init().
You should call rs.init() at least once, even if you don't need to update anything in options, otherwise until first rs.resize(), you will see black screen.
You can pass argument as table with options, or pass nothing to just update. List of options avaliable in source library file.
* rs.setScaleMode() - allow you to change scale mode via number. Pass 1, 2, 3 to change.
* rs.debug - boolean, which controls if rs.debugFunc() will be rendered or not.
* rs.debugFunc() - function that will show some data that useful for debug. Call it somewhere in love.draw() as rs.debugFunc().
* rs.switchDebug() - switch rs.debug, from true to false and vice-versa.
Removed:
* rs.windowChanged() - because now there no need in this callback.
* rs.gameChanged() - also not really useful anymore.
* rs.gameAspect - it was not really useful anyway.
* rs.windowAspect - also not useful.
* rs.update() - explained below.
Changed functionality:
* Before, there was only 2 bars: Left/right or top/bottom and they was avaliable only at scaleMode 1. With intoduced 3rd scale method, Pixel perfect, that has bars at top/bottom/left/right at same time, their functionality changed.
You can still access them as: rs.x1, rs.y1, rs.w1, rs.h1 (from 1 to 4, rs.x1, rs.x2, rs.x3...), but order changed:
1 for top bar
2 for left bar
3 for right bar
4 for bottom bar
* Apperantly, rs.gameZone table was never updated, because i forgot to do so in rs.update... Welp, that sucks. Now it updates properly.
* Now all functions, that expects arguments, have error messages to point out if you passed something wrong. Yay!
* rs.resize - now library update loop was designed around love.resize() function, instead of love.update(), like other scaling libs do. So less wasted frame time, yay! Don't forget to pass w and h from love.resize(w, h) to library as rs.resize(w, h). For compatability sake, it should be possible to put rs.resize at love.update and just pass rs.resize(love.graphics.getWidth(), love.graphics.getHeight()). It was not tested properly, but i believe there shoudn't be any problem with it, except maybe performance.
* rs.switchScaleMode() - before until 3rd scaling method, there was only 2 methods and this function acted more like "boolean". Now, you can pass 1 or -1 to choose how you want to switch methods: 1 -> 2 -> 3 -> 1... or 3 -> 2 -> 1 -> 1...
If you pass nothing, function will act as you passed 1.
Renamed, but functionality the same:
rs.drawBars -> rs.bars
rs.drawBlackBars -> rs.drawBars
rs.switchDrawBars -> rs.switchBars
* Rewrited demo.
* From now on, i will include minified version of library, with removed comments and minified code, that will make filesize lesser.
https://mothereff.in/lua-minifier. Check github page.