Creating Angelscript class instances from C++
How can I create an instance of a class that has been registered in Angelscript? I want to be able to use the Angelscript object like a C++ functor. That is, I create the class in C++ and have a handle to it in C++. The Angelscript class's functions would be called from within my C++ class. That way I could have Angelscript classes that act like they inherit from C++ ones.
asIScriptEngine::CreateScriptObject() can be used to create objects from type ids. The return type should be cast to an asIScriptObject pointer for script objects.
I think you'll find looking at the game sample included in the SDK to be quite interesting.
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement