Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

angelcode script

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 bilgekaan   Members   

122
Like
0Likes
Like

Posted 13 October 2004 - 04:06 AM

hi all is it possible to register enumartions or constants defined in c/c++ to anglescript. for example enums or defines

#2 Andreas Jonsson   Moderators   

4624
Like
0Likes
Like

Posted 13 October 2004 - 06:48 AM

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 about
const 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 section
engine->AddScriptSection(ModuleName, "script", script, strlen(script));

// Build the script
engine->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




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.