rNakrani
18-01-2010 03:44:16
Hello!
So here is my dilemma, or perhaps its an easy thing to do but I haven't figured it out yet. Basically I am using LuaInterface with MOgre so that I can script mostly everything rather than code it.
From a technical level designer's perspective they will need to be able to add their own FrameStartEventHandler, FrameEndEventHandler and Input Handlers (KeyPressed, KeyReleased, etc...).
I can do this with Win32 assemblies like so:
In the example above, I use Lua to create a new Windows Form and add an event handler, completely written in Lua, to the form's Load event. Its great, I love it, it makes development move much faster.
When dealing with the MOgre and MOIS assemblies it is not working with the FrameEvent handlers and Input Event Handlers. For example (with relevant Lua script only):
Has anyone else had to deal with this, or those who are familiar with Lua and LuaInterface have any ideas on how I could get the functionality to have technical level designers script frame and input event handlers?
I am really excited to having a fully scripted engine so easily, if I can get passed these event handler issues I should be pretty much set for a while (one would hope!)
Thanks in advance!
So here is my dilemma, or perhaps its an easy thing to do but I haven't figured it out yet. Basically I am using LuaInterface with MOgre so that I can script mostly everything rather than code it.
From a technical level designer's perspective they will need to be able to add their own FrameStartEventHandler, FrameEndEventHandler and Input Handlers (KeyPressed, KeyReleased, etc...).
I can do this with Win32 assemblies like so:
luanet.load_assembly("System.Windows.Forms")
Form = luanet.import_type("System.Windows.Forms.Form")
function newForm_OnLoad
-- form on load stuff goes here
end
newForm = Form()
newForm.Load:Add(newForm_OnLoad)
newForm:Show()
In the example above, I use Lua to create a new Windows Form and add an event handler, completely written in Lua, to the form's Load event. Its great, I love it, it makes development move much faster.
When dealing with the MOgre and MOIS assemblies it is not working with the FrameEvent handlers and Input Event Handlers. For example (with relevant Lua script only):
luanet.load_assembly("an assembly containing the engine class I created...")
luanet.load_assembly("Mogre")
luanet.load_assembly("MOIS")
function keyboard_KeyPressed(keyEvent)
-- key pressed stuff goes here
end
-- Engine is a class that I have made in C#
-- The CreateKeyboard function creates a new keyboard object from the MOIS Input Manager
-- and it works great
engine = Engine()
keyboard = engine.CreateKeyboard()
-- The following line DOES NOT WORK
keyboard.KeyPressed:Add(keyboard_KeyPressed)
Has anyone else had to deal with this, or those who are familiar with Lua and LuaInterface have any ideas on how I could get the functionality to have technical level designers script frame and input event handlers?
I am really excited to having a fully scripted engine so easily, if I can get passed these event handler issues I should be pretty much set for a while (one would hope!)
Thanks in advance!