I can't seem to find an example either, (maybe add it as a demo to the demo project?).
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 ??);