How do I tell when the window is maximized?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
georgeprosser
Citizen
Posts: 68
Joined: Fri Mar 28, 2014 5:55 pm

How do I tell when the window is maximized?

Post by georgeprosser »

Is there a way to tell when the window has been maximized (ie. the player has pressed the maximize button)? I want to change to borderless fullscreen when this happens.

Perhaps there should be a callback for this?
pedrosgali
Party member
Posts: 107
Joined: Wed Oct 15, 2014 5:00 pm
Location: Yorkshire, England

Re: How do I tell when the window is maximized?

Post by pedrosgali »

The callback is love.resize(w, h), you get passed w and h which are the new size of the window.

Code: Select all

if not wearTheseGlasses() then
  chewing_on_trashcan = true
end
User avatar
georgeprosser
Citizen
Posts: 68
Joined: Fri Mar 28, 2014 5:55 pm

Re: How do I tell when the window is maximized?

Post by georgeprosser »

pedrosgali wrote:The callback is love.resize(w, h), you get passed w and h which are the new size of the window.
But is there a way of telling whether the player just resized the window manually or maximised it?
User avatar
DeltaF1
Citizen
Posts: 64
Joined: Mon Apr 27, 2015 4:12 pm
Location: The Bottom of the Stack
Contact:

Re: How do I tell when the window is maximized?

Post by DeltaF1 »

A bit of a hacky way to do it would be to check if the w and h are the same as the screen dimensions, then assume that they're pressed the maximize button.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: How do I tell when the window is maximized?

Post by Nixola »

They won't be. Windows have borders.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: How do I tell when the window is maximized?

Post by Kingdaro »

Why do you need to do this? Maybe there's another way. EDIT: Never mind, sort of missed the important part of the post. Carry on.
User avatar
georgeprosser
Citizen
Posts: 68
Joined: Fri Mar 28, 2014 5:55 pm

Re: How do I tell when the window is maximized?

Post by georgeprosser »

Well it looks like this is a missing feature so I posted a feature proposal on bitbucket.
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests