Drop file - Nodewebkit

0 favourites
  • 14 posts
From the Asset Store
320 high-quality cinematic sound effects for trailers and game scenes.
  • Problem Description

    In preview mode drop file in window doesn't work.

    In exported , the window react like we drop a file on a browser application.

    Attach a Capx

    [attachment=0:2ej32utg][/attachment:2ej32utg]

    Description of Capx

    On dropped file , load the file into sprite.

    Steps to Reproduce Bug

      Observed Result
      • PREVIEW MODE I can't drop any files in window.
      • EXPORTED When we try drop a file in node-webkit application , the window react like a browser. Example : I drop a PNG file on my node-webkit window , the picture appear in the left-top corner.
      Expected Result When i drop a file in the windows , do an action . Affected Browsers
      • Chrome: NO
      • FireFox: NO
      • Internet Explorer: NO

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    Beta r171

  • Using r171 and you're .capx, I dropped a file and it appeared in the green box OK.

  • construct reinstalled.

    Same problem :

  • have you 32bit or 64bit version ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are you running C2 as administrator? Windows won't let you drag drop files from a non-admin window into an application running as administrator.

  • i have steam version , i launch steam as administrator. When i launch construct i see "(administrator) " in title bar .

  • ok in preview mode , it's work (i have launch construct as normal user). But after exported , it's react like a browser , picture replace all the window.

    Preview mode : Works.

    After export :

  • anyone can try an export and try this ?

  • Exported as Node-Webkit and it works correctly for me also.

  • The export works correctly with minify off. With minify on I get the same result as you

  • I always forget that. I never use minify because I refuse to install JRE,

  • Thank you guys, so the problem come from minifier.

    [quote:29gbwbrt]When exporting, Construct 2 gives the user the option to 'Minify script'. This runs the common and runtime scripts through Google Closure Compiler's ADVANCED_OPTIMIZATIONS mode. This imposes some limitations on what scripts can do. You must obey these limitations when writing your plugins, otherwise your plugin will be broken on export. More details can be found here (http://code.google.com/closure/compiler ... rial3.html).

    The main thing is to always use dot syntax (Object.property) rather than bracket syntax (Object["property"]). All properties using dot syntax are changed by Closure Compiler, but none of the properties in bracket syntax are changed. Therefore, if you use Object.property in one place and Object["property"] in another to access the same property, the plugin will be broken on export. You may still use bracket syntax (e.g. for a dictionary of user-inputted strings) - just be aware of how Closure Compiler will transform the code.

    i think i need change this :

    ...plugins/nodewebkit/runtime.js

    window.ondrop = function (e)

    {

    e.preventDefault();

    for (var i = 0; i < e["dataTransfer"]["files"].length; ++i)

    {

    droppedfile = e["dataTransfer"]["files"]["path"];

    self.runtime.trigger(cr.plugins_.NodeWebkit.prototype.cnds.OnFileDrop, self);

    }

    return false;

    };

    e.preventDefault(); is the function prevent the original event browser , it seems that this function does not work after obfuscation

  • I think the minifier didn't recognise the ondrop or ondragover names used for that. Should be fixed in the next build.

  • [quote:15urpv4i]Construct 2 Release r173

    Bug Fix

    Node-webkit: drag-and-drop support did not always work after minified export

    Now it's work minified.

    Find me a person who regretted the purchase of "construct 2" so ??I could ask him what planet he came from.

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