Plugin developers PLEASE READ: new export testing

0 favourites
From the Asset Store
[C2] [C3] support C3 build service | support Banner ads, Interstitial ads, Rewared video ads.
  • All plugin and behavior developers:

    The new CocoonJS exporter and upcoming directCanvas exporter may need changes to third party plugins/behaviors. In theory, existing plugins should work without modification because the wrappers still run Javascript. However, in practice, some changes may be necessary because they are not based on a full browser - they just simulate one. There may be features missing or working slightly differently to real browsers. This could cause your plugin to break, or worse, prevent the entire project from running at all.

    Simple plugins and behaviors which are logic-only (only make calls to C2's engine) should be fine. However, any plugins which use browser features, such as any DOM calls, use of Image() or Canvas() objects, or controls like listboxes or input fields, may not work or may need changing. Also note anything using jQuery will not work because jQuery is not included in these exporters. The official Button and Textbox plugins are disabled for these exporters because there is not currently an easy way to get them working.

    Please test your plugins and behaviors work when exporting to CocoonJS and (when it comes) directCanvas. This is important to prevent users who use your addons finding their projects are broken in CocoonJS or directCanvas, and if the problem is caused by third party code we can't officially help them.

    Thanks! If you have any questions please ask them in this forum and we'll do our best to help. We may also need to collaborate between ourselves and appMobi and Ludei to get features added that popular third party addons use so we can improve overall support for Construct 2.

  • "Also note anything using jQuery will not work because jQuery is not included in these exporters."

    Uh, how does engine solve this problem since jQuery is used in engine?

  • The main engine has had all references to jQuery disabled when running in CocoonJS or directCanvas. It was a bit tricky, but on the whole it's only used for utilities, form controls, and controlling the canvas in the HTML page. They could all be worked around without jQuery in the wrappers (except form controls which are disabled and won't work at all). It's a pain, but necessary to get it working.

  • Ashley

    Thank you, I will try to update them. <img src="smileys/smiley36.gif" border="0" align="middle" />

  • Hm, I use plenty of canvas stuff in SpriteFont plugin... I'll have to look into this a bit, figure out whether I need to rewrite the drawing functions.

  • Ashley Question about jQuery Call

    Hi, I found that touch plugin had mouse listener created by jQuery calls.

    For example,

        (function (self) {
            return function(info) {

    How does jQuery Calls in these new exporter? Will these jQuery Calls be ignored or...?

  • rexrainbow

    If you look at the latest source, the Touch object will not use jQuery (nor add any mouse events) if this.runtime.isDomFree is set. "DOM free" isn't the best name really, but it's a flag which is true when running in one of the wrappers which is not a full browser (i.e. directCanvas or CocoonJS). Your own plugins can use this to skip calls to jQuery as well.

  • Ashley

    Thanks, I got it.

  • Ashley

    Could these new exporters get external file (since ajax plugin still has jQuery call)?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It would be really useful to get access to files included in the project. Currently, the games only get a black screen when running in CocoonJS launcher (android) if including the Ajax object (even if not using it).

  • basti - that should be fixed in the next build, sounds similar to an already fixed bug report...

  • I tried exporting my project tonight and get a ReferenceError: Can't find variable jQuery in the CocoonJS launcher.

    I assume a plugin is causing this... how can I find out which one? Cocoon doesn't tell me which code is causing it.

  • wgfunstorm - it must be a third party plugin, because the official plugins and behaviors should all work OK. Note from the OP "Also note anything using jQuery will not work because jQuery is not included in these exporters" - you need to check for plugins or behaviors which call jQuery, because jQuery and anything DOM related is not supported in CocoonJS.

  • Including the official AJAX plugin in an otherwise blank project causes the black screen + reference error to appear. Looks like I'm having the same issue as basti. You mentioned above that this should be fixed, do you want another bug report or ... ?

    Using r97 and this test project

  • Ah, I guess AJAX doesn't work in CocoonJS then... don't worry about making a bug report, I'll see if I can stop it breaking it for the next build.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)