Wrapping Lua/C++
Hey I was looking at your wrapping c++ classes in lua article, I must say its been the biggest help in understanding some of the details to me.
The first part I got working no problem, the second part gets me a little stuck. Basically the extra argument isn’t getting passed (I think) Calling Sprite.new(..) only seems to pass the 4 arguments and not the table, what have I missed.
Thanks,
Phil.
That is easy, you have simply used “.” instead of “:”.
Sprite:new(...)
is syntatic sugar in lua for
Sprite.new(Sprite, ...)
That is how you get the table in as first argument.