lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Uhh... How about tolua_touserdata? ;-)

L-28C wrote:
Hello people of Lua town... or list, same thing. :-)

I'm using this function to retrieve Lua global 'BottomLayer' of type 'Image'. I try it but it returns a null pointer:

Image *Map::GetBottomLayer()
{
    lua_getglobal(Script, "BottomLayer");
    return (Image*)tolua_tousertype(Script, 1, 0);
}

I just grabbed the tolua_tousertype from the toLua binding of the Image class. I Googled a bit and the arguments seem alright... What am I doing wrong?

Thanks in advance!