Advertisement

Creating Angelscript class instances from C++

Started by December 13, 2011 09:56 PM
2 comments, last by WitchLord 13 years, 2 months ago
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.
Advertisement
Thanks. Just what I needed to hear.
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