🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
method defining
Hey, I was wondering if it is possebly to
declare a class in c++, and define only SOME of the members in c++.
And define the rest of the methods in angelscript.
Is this poss?
No AngelScript can't do that.
But You might implement a workaround.
Some Python binding libraries use delegates do mimic class extensions. This method can also be used in AngelScript.
Basically You extend the class in c++ and make wrappers for scripted function calls. Extending a class is then a matter of telling an instance of the wrapperclass which script functions to call.
That's not quite the way you know from c++ but it works and you can change method implementation of an instance at runtime.
Cheers
Tom
But You might implement a workaround.
Some Python binding libraries use delegates do mimic class extensions. This method can also be used in AngelScript.
Basically You extend the class in c++ and make wrappers for scripted function calls. Extending a class is then a matter of telling an instance of the wrapperclass which script functions to call.
That's not quite the way you know from c++ but it works and you can change method implementation of an instance at runtime.
Cheers
Tom
In a future version it will be possible to declare a class in AngelScript that inherits from an application registered object.
This is still quite far away though.
This is still quite far away though.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement