Browse Source

Adding JS usage

JoshEngebretson 10 years ago
parent
commit
5822465fdb
1 changed files with 11 additions and 0 deletions
  1. 11 0
      NativePluginExample/Native/MyNativePlugin.cpp

+ 11 - 0
NativePluginExample/Native/MyNativePlugin.cpp

@@ -1,3 +1,14 @@
+/* 
+
+Javascript Usage: 
+
+require("MyNativePlugin");
+
+// call our native method
+var answer = NativePlugin.getAnswer();
+print("The answer is: ", answer, " which is " , NativePlugin.checkAnswer(answer) ? "correct" : "incorrect"); 
+
+*/
 
 // ATOMIC_PLUGIN_MAIN must be defined in one (and only one) plugin source file
 // before including AtomicPlugin.h