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
Description of Capx
On dropped file , load the file into sprite.
Steps to Reproduce Bug
Operating System and Service Pack
Construct 2 Version ID
Using r171 and you're .capx, I dropped a file and it appeared in the green box OK.
Same problem :
have you 32bit or 64bit version ?
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 :
window.ondrop = function (e)
for (var i = 0; i < e["dataTransfer"]["files"].length; ++i)
droppedfile = e["dataTransfer"]["files"]["path"];
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.
Develop games in your browser. Powerful, performant & highly capable.
[quote:15urpv4i]Construct 2 Release r173
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.