🎉 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!

angelcode script

Started by
0 comments, last by WitchLord 19 years, 8 months ago
hi all is it possible to register enumartions or constants defined in c/c++ to anglescript. for example enums or defines
Advertisement
There is no special function for it but you can do it by writing a script section declaring the global constants.

Example:

// Add a script section with the constants that the script should know aboutconst char constants = "const int c_int = 1;""const int c_int2 = 2;";engine->AddScriptSection(ModuleName, "constants", constants, strlen(constants));// Add the normal script in another sectionengine->AddScriptSection(ModuleName, "script", script, strlen(script));// Build the scriptengine->Build(ModuleName);


I may add a way to register enums and constants directly using methods, but I'm not so sure it will be easier than the solution above.

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

This topic is closed to new replies.

Advertisement