CEGUI Lua error

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

hkroger
Just popping in
Just popping in
Posts: 12
Joined: Mon Feb 20, 2006 01:39

CEGUI Lua error

Postby hkroger » Wed Mar 01, 2006 19:46

I get this error when I try to use CEGUI from Lua:

../data/packages/123-123/editor.lua:1: error in function 'new'.
argument #1 is 'class CEGUI::Size'; 'CEGUI::MCLGridRef' expected.

The code which gives this is:

local sizeeee = CEGUI.Size(1,0.1);

Is this some problem with tolua used in CEGUI? How can this be fixed?

hkroger
Just popping in
Just popping in
Posts: 12
Joined: Mon Feb 20, 2006 01:39

Re: CEGUI Lua error

Postby hkroger » Wed Mar 01, 2006 19:54

hkroger wrote:I get this error when I try to use CEGUI from Lua:

../data/packages/123-123/editor.lua:1: error in function 'new'.
argument #1 is 'class CEGUI::Size'; 'CEGUI::MCLGridRef' expected.

The code which gives this is:

local sizeeee = CEGUI.Size(1,0.1);

Is this some problem with tolua used in CEGUI? How can this be fixed?


It should be like this instead:
local sizeeee = CEGUI.Size:new(1,0.1);

Therefore the example in code snippets is not functional.

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

Postby lindquist » Wed Mar 01, 2006 20:07

you assign to a local variable so you'll probably want to use new_local (allow garbage collection).

If you don't free it manually you're causing memory leaks.

Anyway, I know I have upgraded the tolua++ to a version that fixes this problem, it might just have made it to CVS head though...

hkroger
Just popping in
Just popping in
Posts: 12
Joined: Mon Feb 20, 2006 01:39

Postby hkroger » Wed Mar 01, 2006 20:22

lindquist wrote:you assign to a local variable so you'll probably want to use new_local (allow garbage collection).

If you don't free it manually you're causing memory leaks.


Actually, I do, thanks.

lindquist wrote:Anyway, I know I have upgraded the tolua++ to a version that fixes this problem, it might just have made it to CVS head though...


Can you be more spesific on the actual problem?

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

Postby lindquist » Wed Mar 01, 2006 20:38

It's a bug in tolua++ which was fixed in 1.0.6

Fixed class constructor bug (it is now possible to use 'ClassName()' to create a lua-owned instance of the class without problems)


http://www.codenix.com/~tolua/


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 9 guests