Page 2 of 2

Re: Lua, how many of you know it?

Posted: Sat Nov 01, 2008 1:33 am
by M_D_K
to fake OO don't you have to make a table then override the _init or something, I don't know either, but I use it. Tested it by making pong 8-)

Re: Lua, how many of you know it?

Posted: Sat Nov 01, 2008 2:12 am
by Falco Girgis
yeah, something to do with tables and metatables. I tried it once (semi blindly), but then I started with toLua++, which has real Lua OO, so I'm proudly ignorant.

Re: Lua, how many of you know it?

Posted: Sun Nov 02, 2008 1:00 pm
by danR369
You have to make they empty object (the table), set the metamethod to __index, then set the metatable.

Re: Lua, how many of you know it?

Posted: Sun Nov 02, 2008 1:25 pm
by M_D_K
^ what he said :)