lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Quot:

Why doesn't your example work? Aside from a comma missing after
size = "640 480"
it seems like a perfectly legal & workable statement.
Eg, (snipping out bits to shorten it) we have:
CreateGUI
{
name = "Canvas",
bitmap = "./bitmaps/bitmap.jpg",
size = "640 480",
CreateComponent
{
type = "ClockComponent",
name = "Clock",
size = "100 100"
}
}

OR:

GUI
{
	type = "Canvas",
	name = "PlayGUI",
	horizontal = "left",
	vertical = "top",
	position = "0 0",
	visible = 1,
	bitmap = "./bitmaps/bitmap.jpg",
	size = "640 480",

		Component
		{ (*** line 39 ***)
			parent = "PlayGUI",
			type = "TextLabel"
		}
}



It doesn't work. Lua complains:

error: `=' expected;
  last token read: `{' at line 39 in file `scripts/testSDL/gui.lua'
stack traceback:
   1:  function `Exec' [C]
   2:  main of file `scripts/testSDL/main.lua' at line 5
*** Syntax error in script file scripts/testSDL/gui.lua

I wanted to pass the table into a C function, but I haven't managed to get that 
working. That's what I was referring to in my code; sorry if that wasn't clear.

Thanks for your help.
Mike