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

How can I register static method of class by angelscript ?

Started by
1 comment, last by zopenge 16 years, 4 months ago
Seems the same question of registering enum ~~ :) Class A { static float SomeFunc( ) { return 1.0f; } }; How to register A::SomeFunc( ) ? thanks !!!
Advertisement
A static class method really is a global function, so that's how you register it with AngelScript:

engine->RegisterGlobalFunction("float SomeFunc()", asFUNCTION(A::SomeFunc), asCALL_CDECL);


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

Thanks for help so much ~ :)

This topic is closed to new replies.

Advertisement