Resolution Solution [library]

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
GVovkiv
Party member
Posts: 670
Joined: Fri Jan 15, 2021 7:29 am

Re: Resolution Solution [library]

Post by GVovkiv »

togFox wrote: Thu Feb 01, 2024 9:18 am Is this the correct way to initial RS when I develop in 1920 x 1080 while allowing the user to resize to whatever they want?

Code: Select all

res.conf({game_width = 1920, game_height = 1080, scale_mode = 1})
res.setMode(1920, 1080, {resizable=true})
The demo is 800 x 600 so just checking I got this bit right. Thanks.
I mean, there no "correct" way to initialize window, in fact, you can call it whenever you want, after all, res.setMode is just wrapper for https://love2d.org/wiki/love.window.setMode, which would immediately call res.resize to update all internals.
I think you might got math somewhere wrong
User avatar
togFox
Party member
Posts: 779
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Resolution Solution [library]

Post by togFox »

Okay. Thanks. When I develop I use my monitor size so I'll use this code that should take my 1920x1080 and scale it to the users monitor size:

Code: Select all

	res.conf({game_width = 1920, game_height = 1080, scale_mode = 1})
	res.setMode(0, 0, {resizable=false})
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
togFox
Party member
Posts: 779
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Resolution Solution [library]

Post by togFox »

So, documenting here for others, my project is using:

Code: Select all

love.graphics.scale
and

Code: Select all

love.graphics.origin()
These things change the way things are drawn and if you're not careful, will interfere with RS.

Obviously.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
GVovkiv
Party member
Posts: 670
Joined: Fri Jan 15, 2021 7:29 am

Re: Resolution Solution [library]

Post by GVovkiv »

togFox wrote: Sun Feb 04, 2024 12:41 am So, documenting here for others, my project is using:

Code: Select all

love.graphics.scale
and

Code: Select all

love.graphics.origin()
These things change the way things are drawn and if you're not careful, will interfere with RS.

Obviously.
So are you was drawing ui by resetting scaling?
If so, you better off using love.graphics.pop/push combo to draw something inside rs.pop/push combo, or simple draw ui outside of this combo
User avatar
togFox
Party member
Posts: 779
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Resolution Solution [library]

Post by togFox »

Some scenes were using RS and some scenes were using RS and scale. Making sure the rs.pop, rs.push. love.graphics.scale and origin is called in the right sequence and being disciplined in the scope fixes it. Thanks!
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 60 guests