toggleFullscreen() works weird

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
rmn_rmn
Prole
Posts: 21
Joined: Thu Jul 08, 2010 3:04 am

toggleFullscreen() works weird

Post by rmn_rmn »

Hello! Has anybody faced such a bug using love.graphics.toggleFullscreen(), or it's just my machine getting crazy:
I start the game in a fullscreen mode (defined in conf.lua), then in the game I go to the 'Options' menu, push 'Off' button, it works, but when I push 'On' with the same action love.graphics.toggleFullscreen(), it doesn't switch to the initial fullscreen mode. I checked, it returns true, but the result is wrong. May be some of you knows what is the reason?
I run WinXP x64.

Regards,
Roman.
User avatar
rhezalouis
Party member
Posts: 100
Joined: Mon Dec 07, 2009 10:27 am
Location: Indonesia
Contact:

[Response]Hollaaa Roman

Post by rhezalouis »

Could you provide us your code please. ^^
Aargh, I am wasting my posts! My citizenshiiiip... :o
rmn_rmn
Prole
Posts: 21
Joined: Thu Jul 08, 2010 3:04 am

Re: [Response]Hollaaa Roman

Post by rmn_rmn »

rhezalouis wrote:Could you provide us your code please. ^^
Ok, though I think it won't make things clearer. This chunk is sitiuated in :mousepressed() section:

Code: Select all

for n,b in pairs(self.button) do
		if b:mousepressed(x,y,button) then
			if n == "on" then
				love.graphics.toggleFullscreen()
			elseif n == "off" then
				love.graphics.toggleFullscreen()
			elseif n == "back" then
			state = Menu.create()
			end
		end
	end
It's not finished, but already should switch fullscreen mode on click. The problem that it switches once only.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: toggleFullscreen() works weird

Post by kikito »

Stupid question: are you sure that the code is executed?

Maybe the problem is on the if-elseif-elseif. Have you tried putting prints there to be sure that the toggleFullScreen method is called?
When I write def I mean function.
User avatar
rhezalouis
Party member
Posts: 100
Joined: Mon Dec 07, 2009 10:27 am
Location: Indonesia
Contact:

[Hyaa]Sorry

Post by rhezalouis »

Ah, sorry, the problem had been discussed bizzarely here. ^^

You should use love.graphics.setMode() instead [i.e. Robin's hard-core way]. :megagrin:
Here's an example:
fullscreenTest.love
love0.6.2
(429 Bytes) Downloaded 72 times
>the left-mouse-click triggers the not-working toggleFullscreen()
>the right-mouse-click triggers the setMode()

Have fun. :ultrahappy:
Last edited by rhezalouis on Mon Aug 02, 2010 9:57 am, edited 2 times in total.
Aargh, I am wasting my posts! My citizenshiiiip... :o
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: toggleFullscreen() works weird

Post by nevon »

I have the same problem on my laptop. Going fullscreen works fine, but toggling it off doesn't.
rmn_rmn
Prole
Posts: 21
Joined: Thu Jul 08, 2010 3:04 am

Re: toggleFullscreen() works weird

Post by rmn_rmn »

Thank you guys. :) I'll try to use setMode().
Post Reply

Who is online

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