AW: [luabind] Define 'this' constant
Brought to you by:
arvidn,
daniel_wallin
From: Alexander R. <webmaster@SpiderSoftware.de> - 2005-04-18 14:23:38
|
> I'm not sure I understand what you mean, do you mean the 'self' used in > lua? > > -- > Arvid Norberg Exactly, but as a predefined constant. Example : Class scripter { Public : Scripter() { Luabind [ Luabind::class_< scripter >( "c_scripter" ) .def( "test", &scripter::test ) ]; } loadScript( const char* filename ) { ... } }; After creating a new scripter class in c++, also in the internal lua interpreter the class scripter is available. What I want now is, that I can use the created c++ class withing lua. Like this : Lua : Function test() This.test() -- 'This is the current scripter object in which this script is running End C YA - Nuker |