Problems with a simple LUA script (handling?)

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Habba
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue Sep 19, 2006 15:21
Location: Finland
Contact:

Problems with a simple LUA script (handling?)

Postby Habba » Mon Sep 25, 2006 15:18

Since there's practically no references for using LUA with CEGUI, I have spent some time guessing what to do. This is my very first LUA-script, so I'm not sure wether it is correct or not:

Code: Select all

function luabtn_clicked(e)
  local winMgr = CEGUI.WindowManager:getSingleton()
  local temp = ceguiLua_toPushButton(winMgr:getWindow("LuaButton"))
  temp:setText("test")
end


I have a button that is named as "LuaButton" and this script should change it's text into "test". But it doesn't do anything.

If the script is correct, then I guess I have some problems with lauching/handling the script...

User avatar
Trentin
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Tue Nov 22, 2005 21:25
Contact:

Postby Trentin » Mon Oct 23, 2006 16:23

Here's some references I've found:

http://www.cegui.org.uk/wiki/index.php/Tutorials#Scripting_with_CEGUI

http://gpwiki.org/index.php/Crazy_Eddies_GUI_System:Tutorials:Creating_a_scriptable_interface_using_CEGUI#Lua_and_CEGUI


If I had to guess, I'd say you might have forgotten to load the lua file, or register the luabtn_clicked function as an event handler.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 31 guests