creating module

Monkey Archive Forums/Monkey Discussion/creating module

rebelas(Posted 2014) [#1]
Is any guide or tutorial for creating module for monkey?
Any guide to make wrapper for c code?
Any guide to make wrapper for c++ code?
The same for WebGL, or Three.js?


Pharmhaus(Posted 2014) [#2]

Is any guide or tutorial for creating module for monkey?


Just create a new folder in your 'modules' folder e.g. C:\MonkeyPro\modules\rebelas
you can now put your .monkey files there. If you're using Jungle, click "Modules">"update monkey modules database" afterwards.
you should then be able to
import rebelas.name_of_the_monkey_file

to use it.


Any guide to make wrapper for c code?
Any guide to make wrapper for c++ code?
The same for WebGL, or Three.js?



Its basically just *Extern* and Import.
You can take a look how BRL did it e.g. by opening C:\MonkeyPro\modules\os\os.monkey and C:\MonkeyPro\modules\os\native\os.cpp

Edit: You might be interested how to handle cstrings
See my Post #10 there.


rebelas(Posted 2014) [#3]
Thanks!


ziggy(Posted 2014) [#4]
If you're using Jungle Ide, it is a good idea to configure an additional modules folder on preferences (Tools / Preferences) select "Monkey" tab.
Doing it, you can place your own modules in an additional modules folder, so you don't have to copy all your custom modules when you update Monkey to a new version. That's very handly. See more info here: http://manual.jungleide.com/setting-up-jungle-ide/tips-to-enjoy-jungle-ide/