lua-users home
lua-l archive

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


Hi,

I´m using Lunar (http://lua-users.org/wiki/CppBindingWithLunar for binding Lua to my application, but I have a problem.

I need that the created objects have callbacks functions to be called in C++ code, like in this example:


function Obj1Update()
...
end

function Obj2Update()
...
end

obj1 = Object:new()
obj2 = Object:new() 

obj1._onUpdate_ = Obj1Update
obj2._onUpdate_ = Obj2Update 

Then, in C++ code, I need to call the "onUpdate" function for the object.

Other callbacks could be "onCollide", "onClick", etc.

Is that possible?

Thanks

Jose