I'm investigating the JavaScriptEngine but i'm not sure if fully understand how these 'DynamicObjects' work.
I can't seem to find an example either, (maybe add it as a demo to the demo project?).
I got the JavaScript engine running, i use it in collaboration with OpenGL, so the user can enter a script (like in processing) and the OpenGL engine does the hard work.
I managed to add a color object and i'm able to set the color properties from script, see below
dynamicObject = new DynamicObject();
dynamicObject->setProperty("r", "0.0f");
dynamicObject->setProperty("g", "0.0f");
dynamicObject->setProperty("b", "0.0f");
dynamicObject->setProperty("a", "1.0f");
jsengine.registerNativeObject("color", dynamicObject);
But how to add a method like say 'fillRect' that takes four floats as arguments?
Could someone give me a pointer on how to do this?
dynamicObject.setMethod ("fillRect", var::NativeFunction function ??);
