How to define functions that return script object types?

Recommended Posts

Hello,

I'm trying to expose my application interface to angelscript using class wrappers. I'm doing so to allow further inheritance in script sources. Basically what I'm doing is this:

First, I'm registering a C++ class, say 'MyObject', as 'NativeMyObject'.

Then, I add a script section to my global module:

class MyObject : NativeMyObject
{
... // wrap all the methods and stuff of the 'real' MyObject.
}


Right after that I build the module.

What I want to do next is registering a global function that returns a MyObject (not NativeMyObject!). This however seems to be impossible due to MyObject no being know to the global namespace.

Is there any way to get around this issue? I guess the idea of having derivable script classes from native C++ classes may be very common and I'm just doing something wrong here.

Any help ist greatly appreciated!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• Forum Statistics

• Total Topics
627735
• Total Posts
2978854

• 10
• 10
• 21
• 14
• 12