I am just trying to get a simple demo working where I have a button that I create in a layout and have it call a LUA function when clicked. The problem is that I cannot access anything in CEGUI through LUA. I get the following error when trying to execute a script that tries to log something.
script:
function luabtn_clicked(e)
local we = CEGUI.toWindowEventArgs(e)
we.window:setText("handled from Lua");
end
local logger = CEGUI.Logger:getSingleton()
logger:logEvent( ">>> Init script says hello" )
error:
03/01/2007 18:04:57 (Error) Exception: Unable to execute Lua script file: 'scripts/script.lua'
[string "scripts/Login.lua"]:6: attempt to index global `CEGUI' (a nil value)
03/01/2007 18:04:57 (Error) Exception: System::executeScriptFile - An exception was thrown during the execution of the script file.
I think it is something simple that I am missing, but I cannot figure out what is causing the problem.
Problem with LUA not having acces to CEGUI objects.
Moderators: CEGUI MVP, CEGUI Team
The only thing I can think of is are you creating the LuaScriptModule? I create it just before I create the CEGUI::System object.
Maybe that'll help...
Code: Select all
pGUIScriptModule = new CEGUI::LuaScriptModule(...);
pGUISystem = new CEGUI::System(...);
Maybe that'll help...
Who is online
Users browsing this forum: No registered users and 18 guests