🎉 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 operator function of class ?

Started by
1 comment, last by zopenge 16 years, 4 months ago
class A { operator int( ) { // do something ... } }; How to register this in angelscript ? thansk !!!
Advertisement
Documentation

For your particular example you would register it as:

r = engine->RegisterObjectBehaviour("type", asBEHAVE_VALUE_CAST, "int f()", asMETHOD(A, operator int), asCALL_THISCALL); assert( r >= 0 );

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Oh, Thanks so so so much :)

This topic is closed to new replies.

Advertisement