Page 1 of 1

Mac 10.9 love.graphics.setMode() issue

Posted: Fri Mar 21, 2014 8:02 pm
by Cereal
This is actually a problem that popped up some months ago during the last BaconGameJam, but I don't think I ever posted about it.

Basically, if I run the folder on my mac, I get a "attempted to call field 'setMode' (a nil value)".

The function in question is:

Code: Select all

function init()
	love.graphics.setMode(25*tileSize, 25*tileSize, false, false, 0)
	...
It works fine on windows, but with the next game jam coming up in a couple of hours, I figure it might be a good idea to see if you have a solution for me!

Edit: Oh, I should say where it's being called from.

Code: Select all

function love.load()
	local sound = love.audio.newSource("lib/music1.mp3")
	sound:setVolume(.2)
	sound:setLooping(true)
	love.audio.play(sound)
	goalSound:setVolume(.2)
	goalSound:rewind()
	img = love.graphics.newImage("lib/HowToPlay.png")
	q = love.graphics.newQuad(0,0,800,800,800,800)
	thanksimg = love.graphics.newImage("lib/thanks.png")
	tq = love.graphics.newQuad(0,0,800,800,800,800)
	loadMap(firstLevel)
	init()
	
end
I moved init() above all the over love.graphics. calls on the off chance it had something to do with that, but it didn't change anything.

Edit2: The source is here: https://bitbucket.org/HorizonShadow/gam ... ?at=master
Cheers.

Re: Mac 10.9 love.graphics.setMode() issue

Posted: Fri Mar 21, 2014 8:07 pm
by slime
LÖVE 0.9 doesn't have love.graphics.setMode anymore, the function got moved to the (new as of 0.9.0) [wiki]love.window[/wiki] module as [wiki]love.window.setMode[/wiki], and its arguments changed slightly.

It sounds like you're running LÖVE 0.8.0 on Windows and 0.9.0 on OS X. The best solution would probably be to update to 0.9.0 on windows. It has a fair number of incompatibilities with 0.8.0, but most are just renamed functions.

Re: Mac 10.9 love.graphics.setMode() issue

Posted: Sat Mar 22, 2014 9:51 pm
by Cereal
slime wrote:LÖVE 0.9 doesn't have love.graphics.setMode anymore, the function got moved to the (new as of 0.9.0) [wiki]love.window[/wiki] module as [wiki]love.window.setMode[/wiki], and its arguments changed slightly.

It sounds like you're running LÖVE 0.8.0 on Windows and 0.9.0 on OS X. The best solution would probably be to update to 0.9.0 on windows. It has a fair number of incompatibilities with 0.8.0, but most are just renamed functions.
Thank you kindly. That was the issue.