Page 4 of 4

Re: TLfres - resolution freedom

Posted: Fri Jan 18, 2013 4:42 pm
by Davidobot
Can this be used with a camera lib? I tried it and it screwed up my entire game. :|

Re: TLfres - resolution freedom

Posted: Fri Oct 18, 2013 9:31 am
by Teraku
Sorry for bumping this, but I'm having a bit of a problem. I originally programmed my game to work at a resolution of 1280x720, but I would like to be able to have the game play in 1024x768 instead. However, I just get a black screen when using this.

I don't really understand how you're supposed to use TLfres.setScreen() with arguments. Could anyone give me an example?

Re: TLfres - resolution freedom

Posted: Fri Mar 11, 2016 7:37 am
by Taehl
This library is very old and not compatible with modern versions of Love2D. I'm going to port it once I can figure out the correct aspect ratio math instead of my old kludge.

Re: TLfres - resolution freedom

Posted: Wed Apr 07, 2021 4:32 am
by knorke
(old thread but it seems to be the newest?)
So I dug up an old löve project on an old harddisk. It was in 800x600 resolution and I had never bothered to deal with the boring maths of screen resolutions and ratios. I found https://love2d.org/wiki/TLfres , did as written in the instruction and it worked.
Thanks!

Small note:
TLfres does not set the BlendMode. My game was drawing over the letterboxes because the last used blendmode in love.draw() had been "add".
(If you draw a circle with centerpoint at x=0 then half the circle will be offscreen. Or in case of using TLfres: on top the letterbox)
Fix:

Code: Select all

love.graphics.setBlendMode("alpha")
TLfres.endRendering({0.1,0,0.1})

Re: TLfres - resolution freedom

Posted: Wed Apr 07, 2021 8:00 am
by togFox
I get a black screen but would love to see this working.

Edit: IDK why but it started working when I defined a letterbox colour (instead of relying on default). Makes no sense.

Re: TLfres - resolution freedom

Posted: Sun Jun 06, 2021 4:43 am
by knorke
I noticed some strange behaviour:
When using fullscreen, sometimes after a few minutes my game randomly gets rendered in the original desktop resolution instead of the TLfres resolution of 800x600. When that happens, everything gets rendered in the upper left corner of the screen and at smaller scale. Strangely, a love.particleSystem that I use as background animation still gets drawn correctly in the middle of the screen.
Sadly my game's code is a total mess, maybe I can provide a cleaner example at some time. Until then does anyone have an idea what might cause this? This is on windows 10.

Re: TLfres - resolution freedom

Posted: Mon Jun 07, 2021 2:05 am
by knorke
as not be a DenverCoder9, I'll reply to myself :roll:
my game had two places where stuff was drawn like this:

Code: Select all

love.graphics.translate(v.b:getX(), v.b:getY())
love.graphics.polygon("line", v.s:getPoints())
love.graphics.origin()
that caused the translate/scale to get messed up. Replaced like this:

Code: Select all

love.graphics.translate(v.b:getX(), v.b:getY())
love.graphics.polygon("line", v.b:getWorldPoints(v.s:getPoints()))
So it was a mistake in my code. Maybe a thing to learn here is that when using this, one has to be careful with graphics states/modes. (also see previous post on BlendMode)