Sign in to follow this  

How to define functions that return script object types?

This topic is 1198 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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!

 

 

Share this post


Link to post
Share on other sites

This topic is 1198 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this