Advertisement

registering virtual properties

Started by November 16, 2012 01:02 PM
1 comment, last by _Engine_ 12 years ago
Hi!

I can declare global class throught binding with c++ code. Can i bind virtual properties? I don't find any clue in documentation about this feature (((
Virtual properties are registered with the engine by registering a pair of get and set functions. For example:


engine->RegisterGlobalFunction("int get_GlobProp()", asFUNCTION(get_GlobProp), asCALL_CDECL);
engine->RegisterGlobalFunction("void set_GlobProp(int)", asFUNCTION(set_GlobProp), asCALL_CDECL);

engine->RegisterObjectMethod("Obj", "int get_ObjProp()", asMETHOD(Obj, get_ObjProp), asCALL_THISCALL);
engine->RegisterObjectMethod("Obj", "void set_ObjProp(int)", asMETHOD(Obj, set_ObjProp), asCALL_THISCALL);


Manual entries describing this:

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
Yep, this is working :)

Thank you.

This topic is closed to new replies.

Advertisement