Page 1 of 1

Broken since 0.9.x

Posted: Fri Apr 18, 2014 2:18 am
by tomshreds
Hi,

I haven't use love2d since a year+ and when I tried to start an old prototype I got an error about my conf.lua

I used to do this:
Anickyan wrote:Actually, this would be the easiest, I think:

conf.lua

Code: Select all

configTable = {} -- use any variable name

function love.conf(t)
  t.screen.width = 800
  t.screen.height = 600
  t.title = "Test Window"
  configTable = t
end
main.lua

Code: Select all

function love.load()
  local screenWidth = configTable.screen.width -- access all of the values inside the table
end
is there anything that has changed related to that? what are the major points of 0.9?

This is what I get:

Code: Select all

tommy@chrubuntu:~/Downloads/igs_lua$ love .
conf.lua:11: attempt to index field 'screen' (a nil value)
Error: main.lua:2: attempt to index field 'screen' (a nil value)
stack traceback:
	main.lua:2: in main chunk
	[C]: in function 'require'
	[string "boot.lua"]:360: in function <[string "boot.lua"]:241>
	[C]: in function 'xpcall'
Any idea or suggestion?

I'm so glad to be back here :D Thanks!

Re: Broken since 0.9.x

Posted: Fri Apr 18, 2014 2:30 am
by slime
t.screen in [wiki]love.conf[/wiki] was renamed to t.window in [wiki]0.9.0[/wiki].

Re: Broken since 0.9.x

Posted: Fri Apr 18, 2014 3:14 am
by tomshreds
slime wrote:t.screen in [wiki]love.conf[/wiki] was renamed to t.window in [wiki]0.9.0[/wiki].
Exactly what I was looking for! Thanks :)