• Advertisement
  • entries
  • comments
  • views


Sign in to follow this  


Awww yeah. Check this out...

A custom class declaration:-

public class Test
public Test()
testMember = 100;
stringData = "";
floatMember = 14.2f;

public void DoSomething()

public int testMember;
public string stringData;
public float floatMember;

And then to bind it:

using GMDotNet;

static void Main(string[] args)
Machine m = new Machine();
int ret = 0;
ret = m.ExecuteString("global a = Test();");

ret = m.ExecuteString("a.testMember = 50;");
ret = m.ExecuteString("print( a.testMember );");

ret = m.ExecuteString("a.stringData = \"Hello there\";");
ret = m.ExecuteString("print( a.stringData );");

ret = m.ExecuteString("print( a.floatMember );");
ret = m.ExecuteString("a.floatMember = 50.6f;");
ret = m.ExecuteString("print( a.floatMember );");

And hey presto, simple GM class binding...

Now for the more 'complex' examples :(
Sign in to follow this  


Recommended Comments

OMG GM!!!!! You've made some progress with that.

Would it be possible to add a "Type" to GM? It would be really cool if we could expose full .NET Assemblies to GM [wink].

Share this comment

Link to comment
That looks really nice. I've been looking into nekovm binding and have dispatched SHilbert to write a nicer version of SHilScript for possible research and use.

But GameMonkey intrigues me, particularly if I can bind objects and use it across platforms.

Share this comment

Link to comment

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

  • Advertisement