scripting suggestions

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: scripting suggestions

Postby CrazyEddie » Sun Mar 27, 2005 10:11

I've added you to the project as a developer and, for the moment, just given write access to the Lua script module parts of the project. If things pan out okay, I'll consider extending this to full write access after a short time ;)

CE.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: scripting suggestions

Postby lindquist » Sun Mar 27, 2005 15:47

hi again. this sounds great.

I'm pretty new to CVS though.

I on Windows XP using TortoiseCVS.
Currently I'm set up for anonymous access.
I really don't want to mess up anything so I'll ask before i try.

Do I just change the cegui_mk2/ScriptingModules/CEGUILua/CVS/Root to:

Code: Select all

:ext:lindquist@cvs.sourceforge.net:/cvsroot/crayzedsgui
or is there something more involved ?

thanx

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: scripting suggestions

Postby CrazyEddie » Sun Mar 27, 2005 16:19

You could do that, but since you have developer access to the repository, it's probably easier to just check out a new copy using the server string you pasted above.

commits will then work in the directories for which you have write access, you do not need to worry about affecting other stuff since the server will enforce the permissions I have set (if you have other local changes, just commit in the CEGUILua directory, to save you getting 'access denined' type errors).

CE.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: scripting suggestions

Postby lindquist » Sun Mar 27, 2005 16:23

cool,
thanx man :hammer:

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: scripting suggestions

Postby CrazyEddie » Sun Mar 27, 2005 17:04

All this would have been okay, except i made a mistake in the CVSROOT/avail file which controls access to the repository, and now nobody has any write access at all (even me) :roll:

I'll get this sorted ASAP :oops:

CE

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: scripting suggestions

Postby lindquist » Sun Mar 27, 2005 17:19

ahh... that explains my trouble :shock:

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: scripting suggestions

Postby lindquist » Fri May 20, 2005 16:58

I'm working on bindings for all the widgets too.
So soon the Lua script module should be nearly complete.

Stay tuned.

User avatar
Acrion
Just popping in
Just popping in
Posts: 18
Joined: Tue Jun 28, 2005 18:45
Location: Maine, USA
Contact:

Including LuaScriptModule.h

Postby Acrion » Sat Jul 02, 2005 14:19

What is the politically correct way to include LuaScriptModule? Is the standard in CEGUI to add
ScriptingModules/CEGUILua/LuaScriptModule/include to the include paths or be releative? I want my app to be able to be compiled "out-of-the-box" if at all possible.

Short of:

Code: Select all

#include "../ScriptingModules/CEGUILua/LuaScriptModule/include/LuaScriptModule.h"


Thanks
[font=Verdana][size=xx-small]"It's not hard to stand out when the general level of competence is so low" -EMH[/size][/font]
namik@flashmail.com

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: scripting suggestions

Postby CrazyEddie » Sun Jul 03, 2005 09:40

Since the official lua module is fairly new, I don't think there is an official or recommended approach; basically it's a case of whatever works.

Having said that, I think that adding another include search path may be the best approach though.

User avatar
jacmoe
Just can't stay away
Just can't stay away
Posts: 136
Joined: Sun Apr 03, 2005 14:18
Location: Holbaek, Denmark
Contact:

Re: scripting suggestions

Postby jacmoe » Sun Jul 03, 2005 12:38

I think adding it to your projects include search path is the *best* way to do it.
That way you don't have to change paths in your code, should the CEGUI team decide to move it. ;)

User avatar
Sarev0k
Just popping in
Just popping in
Posts: 6
Joined: Fri Feb 18, 2005 00:36
Contact:

Re: scripting suggestions

Postby Sarev0k » Sun Jul 03, 2005 20:09

I've got a question for you guys. I recently got the scripting module up and running and so far am very impressed with it. It will really clean up a lot of code I would have had to write to script a lot of my menus together.

My question is that when I use the following lua code to get a handle to a window

Code: Select all

local imgLogo = CEGUI.WindowManager:getSingleton():getWindow("Main/Title");


how would I then cast that handle to its appropriate child type? In this case its supposed to be a StaticImage. Is there some conversion function that I'm not aware of? Or is there some crazy way in lua to cast a variable as another type?

Thanks for your help

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: scripting suggestions

Postby CrazyEddie » Mon Jul 04, 2005 06:52

I'm going to have to give the same answer I gave elsewhere...

Lindquist, who is away at the moment, has some enhancements for the script module ready to be committed. I would imagibe that there's a good chance that part of this may be Window casting helpers.

In the mean time, you may be able to get what you want via the properties interface.

CE.

User avatar
Sarev0k
Just popping in
Just popping in
Posts: 6
Joined: Fri Feb 18, 2005 00:36
Contact:

Re: scripting suggestions

Postby Sarev0k » Mon Jul 04, 2005 13:40

Ahh ok, then would it be possible to change the image of a StaticImage via the properties interface? I had looked into it earlier but couldn't figure out how it might be done.

Thanks

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: scripting suggestions

Postby lindquist » Mon Jul 04, 2005 13:55

I'm really tired (got 3 hours of sleep this night), but I'll try to get it committed tomorrow.

I have'nt actually made any casting helpers, as tolua++ has it's own mechanism. So you can do it like this (when the new stuff gets in):

Code: Select all

imgLogo = tolua.cast(imgLogo,"CEGUI::StaticImage");


It might not be such a bad idea though. I could imagine that it would be faster too.
Yeah. I'll make some helper functions for it like I did with the EventArgs - which by the way can be casted with the tolua.cast(...) function too, like this example:

Code: Select all

local we = tolua.cast(e,"CEGUI::WindowEventArgs")


I'll update the lua snippet wiki page to show this...

User avatar
Acrion
Just popping in
Just popping in
Posts: 18
Joined: Tue Jun 28, 2005 18:45
Location: Maine, USA
Contact:

Re: scripting suggestions

Postby Acrion » Mon Jul 04, 2005 14:10

This is how I set the image properties for a button.

Code: Select all

local button = WindowManager:createWindow( "WindowsLook/Button", name .. ".New" .. element )
setProperties( fw, button, CEGUI.Absolute, 8.0 + x * 26, 76.0 + y * 26, 24, 24)
button:setProperty("NormalImage", "set:ToolIcons image:" .. element .. ".Normal")
button:setProperty("PushedImage", "set:ToolIcons image:" .. element .. ".Pushed")
button:setProperty("HoverImage",  "set:ToolIcons image:" .. element .. ".Hover")
button:subscribeEvent( "Clicked", "Tool_Clicked" )
[font=Verdana][size=xx-small]"It's not hard to stand out when the general level of competence is so low" -EMH[/size][/font]

namik@flashmail.com


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests