Sign in to follow this  

how use the enum of class by angelscript ?

Recommended Posts

Currently you can only do this by declaring constants in the script, e.g.:

const char *scriptConstants =
"const int _CODE_NONE = 0; const int _CODE_ONE = 1;";
engine->AddScriptSection(module, "constants", scriptConstants, strlen(scriptConstants));

// Add the normal script section to the same module, then build it

However, as of the next release AngelScript will support true enums. Digital_Asphyxia already sent me the code that implements this support, I just have to include it in the library. Hopefully, by the end of the week, the WIP version in SVN will already have the support.


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