Quest for a resizable game window!

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Quest for a resizable game window!

Post by tomshreds »

Hi,

I've been trying multiple ways of implementing resolution scaling.

But one thing I noticed is: the main game window (when not fullscreen) has not "resizable" feature. The maximize button is disabled.

Anyone knows if it's possible to make game resizable on-the-fly?

Here's my latest attempts:

1) I tested with scale() but unfortunately it doesn't do what I want at all. I'd need full resolutions compatibility while fullscreen AND windowed.

2) I also tested TLfres which sounded good at first, until I tested last version. Last version didn't worked at all for me, I had to downgrade to an earlier version of the library and even then many of the stuff I draw on the screen were SUPER off from where they're supposed to be. You can checkout the thread here:
viewtopic.php?f=5&t=2900&p=74047#p74047

I'd love TLfres to work. It looks like my best bet, but I really need someone who did it to tell me what should I do exactly.

TL;DR:
I want resizable game window while windowed and also all resolutions support when fullscreen. Is this even possible with Löve?

Thanks a lot, any help will be very appreciated since I've been fiddling with this for the last month.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Quest for a resizable game window!

Post by bartbes »

This is impossible in 0.8.0, it should be possible in 0.9.0, though.
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Re: Quest for a resizable game window!

Post by tomshreds »

bartbes wrote:This is impossible in 0.8.0, it should be possible in 0.9.0, though.
Oh. Ok. 0.9.0? Where? Is there any alpha/beta or something? I didn't read anything about 0.9 yet.

If not then if I can make TLfres work I'll just make a windowed resolutions menu I guess.

Thanks for the insight!
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Quest for a resizable game window!

Post by Inny »

I use this one as example a bunch: In Your Face City Trains. The author of that game bound the keys 1 through 4 as shortcuts for resizing the window. Until 0.9.0, I find it an acceptable compromise. Personally, I use F5 as the key, and it rotates through different window sizes.
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Re: Quest for a resizable game window!

Post by tomshreds »

Inny wrote:I use this one as example a bunch: In Your Face City Trains. The author of that game bound the keys 1 through 4 as shortcuts for resizing the window. Until 0.9.0, I find it an acceptable compromise. Personally, I use F5 as the key, and it rotates through different window sizes.
Wow thanks! This is a very very good starting point! I'll check the source out :-D
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Quest for a resizable game window!

Post by josefnpat »

tomshreds wrote:Oh. Ok. 0.9.0? Where? Is there any alpha/beta or something? I didn't read anything about 0.9 yet.

If not then if I can make TLfres work I'll just make a windowed resolutions menu I guess.

Thanks for the insight!
From what I recall, it's in tip. If you pull from the repo and build it yourself, you should have a good idea of how it works. I understand there's callbacks as well!
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Re: Quest for a resizable game window!

Post by tomshreds »

Based on that game I finally had it working. Now it scales with predefined scales.

Now I'd need to draw the content in the middle of the screen so that I could use pre-defined resolutions and letterbox the extra space.

Any known way to draw everything in the middle of the screen? I know TLfres does letterboxing, is there any alternatives?

--

About 0.9: once I compile it, how will I know how to use it? How do I know API changes and 0.9-related stuff?

I guess I could check out the source, that should be a good start!

Thanks again!
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Re: Quest for a resizable game window!

Post by tomshreds »

I'm having a problem with setMode().

Whenever I resize a window, I still use the proper calculations so if I want to put something in the top-right corner.

I'll do draw('bleh example', love.graphics.getWidth() - objectWidth, 10) (no syntax here, just so you understand right). And normally it shows at the right place.

But if I put another resolution, a larger one for example. Stuff will get drawn in the void. Because it seems like the window size and the game's coordinates are not related anymore.

So if the width of the screen is 1440, and I draw something at 1350 I won't see it, but the width of the game WINDOW will still be 1440 anyways.

I wonder if anyone will be able to understand this, but if yes please help me!

Thanks!
User avatar
markgo
Party member
Posts: 190
Joined: Sat Jan 05, 2013 12:21 am
Location: USA

Re: Quest for a resizable game window!

Post by markgo »

Try this and see how scaling stuff works.
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Re: Quest for a resizable game window!

Post by tomshreds »

Very nice! This might be exactly what I'm looking for! Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 77 guests