First of all here is my log and gui creation code (just to confirm that everything loaded OK)
Code: Select all
22/09/2013 08:02:18 (Std) ********************************************************************************
22/09/2013 08:02:18 (Std) * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM -------- *
22/09/2013 08:02:18 (Std) ********************************************************************************
22/09/2013 08:02:18 (Std) ---- Version: 0.8.2 (Build: Sep 20 2013 Microsoft Windows MSVC++ 11.0 32 bit) ----
22/09/2013 08:02:18 (Std) ---- Renderer module is: CEGUI::IrrlichtRenderer - Official Irrlicht based 2nd generation renderer module. RenderTarget support is enabled. ----
22/09/2013 08:02:18 (Std) ---- XML Parser module is: CEGUI::TinyXMLParser - Official tinyXML based parser module for CEGUI ----
22/09/2013 08:02:18 (Std) ---- Image Codec module is: FreeImageCodec - FreeImage based image codec ----
22/09/2013 08:02:18 (Std) ---- Scripting module is: CEGUI::LuaScriptModule - Official Lua based scripting module for CEGUI ----
22/09/2013 08:02:18 (Std) ********************************************************************************
22/09/2013 08:02:18 (Std) * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM -------- *
Code: Select all
GuiRenderer = &CEGUI::IrrlichtRenderer::create( device );
CEGUI::DefaultResourceProvider* rp = new CEGUI::DefaultResourceProvider;
...
CEGUI::LuaScriptModule* script_module = &CEGUI::LuaScriptModule::create();
CEGUI::TinyXMLParser* xml_parser = new CEGUI::TinyXMLParser;
CEGUI::FreeImageImageCodec* image_codec = new CEGUI::FreeImageImageCodec;
CEGUI::System::create( *GuiRenderer, rp, xml_parser, image_codec, script_module, "../datafiles/gui.cfg", "gui.log");
gui.cfg script:
Code: Select all
<?xml version="1.0" ?>
<CEGUIConfig>
<Scripting
initScript="init_script.lua"
/>
</CEGUIConfig>
init_script.lua contains this function and loads a layout
Code: Select all
function button_clicked(e)
local logger = CEGUI.Logger:getSingleton()
logger:logEvent( ">>> It works" )
end
(layout load)
This file (and Lua as well) works since I can see my layout ui and some other events are logged to my log file.
layout:
Code: Select all
...
<Window type="TaharezLook/Button" name="Button3" >
<Property name="Area" value="{{0,120},{0,100},{0,216},{0,132}}" />
<Property name="Text" value="A button" />
<Event Name="Clicked" Function="button_clicked" />
</Window>
...
It should call the lua function "button_clicked()" but it does not. Button is clicked (I can see hover/pressdown images) but nothing happens. There is no errors in logfile/console too. Do I need something else?