Advertisement

Static method members in AngelScript

Started by October 25, 2011 06:41 PM
2 comments, last by WitchLord 13 years, 1 month ago
Hi,

currently i try to write the following Angelscript script:

class Mana
{
Mana()
{
}

// Destructor
~Mana()
{
}

static int GetTestValue() //I know that this not work.
{
return 555;
}
}


I will call the function like:

int test=Mana.GetTestValue();

Is there a possibility to implement static methods in a class or put them in a namespace in AngelScript?

Sincerly,

seeseekey
Not yet.

I've not implemented namespaces in AngelScript yet. A static method is just a global function in the namespace of the class, so can only be supported once I have namespaces.

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

Advertisement
Namespaces will be a very welcome addition once they're added. What is the likelihood that improved module importing will come with it?
Rantings, ravings, and occasional insight from your typical code-monkey: http://angryprogrammingprimate.blogspot.com/
Improvements will always come. You may be interested in the new 'shared code' feature that I'm implementing for 2.22.0. It will allow multiple modules to share the same classes (not just interfaces as before). I will eventually expand this to allow sharing of global variables and functions too, though not for 2.22.0.

What exactly did you have in mind with improved module importing?

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