Class methods

Hi,

All the classes I created until now had a couple of class method that were exposes to the Javascript side.
Is it also possible to have instance methods?
How do I expose the constructor? Or is that work done in the “Register” method each time JS creates a new instance?

Train doesn’t current use any constructors. Javascript only has functions on objects, not really instance vs class methods. For “instance methods” you’d have to create a prototype class and register the “class” as an EcmascriptFunctionObject (MakeFunction does that). when calling “new” on that it calls that method. The resulting object should have a new object with the prototype class as prototype.

It seems like I need access to “GlobalObject” is that correct?
But that is a private var in the “Engine” class…