[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Question about using Lua for defining GUIs
- From: pixellent@...
- Date: Fri, 10 Jan 2003 13:35:19 -0500
I'm using Lua in a game framework that I'm prototyping and I'd like to try to
use Lua as a GUI definition language. I'd like to implement something like the
following, assuming that CreateGUI and CreateComponent are C functions that are
exported to Lua scripts:
in gui.lua:
CreateGUI
{
name = "Canvas",
horizontal = "left",
vertical = "top",
position = "0 0",
visible = 1,
bitmap = "./bitmaps/bitmap.jpg",
size = "640 480"
CreateComponent
{
type = "ClockComponent",
name = "Clock",
horizontal = "left",
vertical = "top",
position = "0 0",
visible = 1,
size = "100 100"
}
}
Now I know that the above doesn't work, but it's what I would like. Now,
instead I could do:
CreateGUI
{
name = "Canvas",
horizontal = "left",
vertical = "top",
position = "0 0",
visible = 1,
bitmap = "./bitmaps/bitmap.jpg",
size = "640 480"
}
CreateComponent
{
type = "ClockComponent",
parent = "Canvas",
name = "Clock",
horizontal = "left",
vertical = "top",
position = "0 0",
visible = 1,
size = "100 100"
}
But I haven't found how to parse through this from within C. Are there any
examples of this somewhere, or could someone give me a few pointers how to walk
through this in C?
Many thanks