Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

registering virtual properties

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 _Engine_   Members   

309
Like
0Likes
Like

Posted 16 November 2012 - 07:02 AM

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 (((

#2 Andreas Jonsson   Moderators   

4629
Like
0Likes
Like

Posted 16 November 2012 - 07:43 AM

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:Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 _Engine_   Members   

309
Like
0Likes
Like

Posted 17 November 2012 - 05:12 AM

Yep, this is working :)

Thank you.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.