Sign in to follow this  
goruka

Custom Binding

Recommended Posts

Hi! I have a question, is there any way i can do custom binding of classes? Imagine I want to deal with some abstract game data as if it was part of a class, containing methods and properties (but they actually don't exist in game, or not as such). So basically, i'd like to create some object that tells angelscript which functions and properties it has, so i can handle myself the behavior on set/get/operators/etc. (maybe something like fallbacks in lua?) Cheers

Share this post


Link to post
Share on other sites
You can register your own classes with AngelScript. You'll then tell AngelScript what methods and behaviours it has. Since the methods and behaviours are implemented by the application you can have them pick up their information from anywhere you want.

AngelScript currently doesn't support setters and getters for properties, though it is planned for the future. Currently you'll have to implement this via exposing two methods instead.

Regards,
Andreas

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this