• Advertisement
Sign in to follow this  

How can I register a static const class field?

This topic is 1727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I  want to register a const unsigned int value

but the enum is only support int type

so I can't use it

finally I only could use RegisterGlobalProperty

but it can't recieve a const value

....How can I do it ?

Share this post


Link to post
Share on other sites
Advertisement

Angelscript doesn't currently support static class members in the script language, if that's what you're asking.

 

If you're trying to expose a C++ static class member to Angelscript, you can cast the const away with const_cast (I can't believe I'm recommending the use of const_cast). There's probably a better way, but that's how I've been doing it in my engine.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement