Drag and drop images into Construct ?

This forum is currently in read-only mode.
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Can you drag and drop files(.png images) into a Construct game or app while its running ?

  • You'll have to use python to achieve that. Here is a topic with an example:

    http://www.scirra.com/forum/drag-and-drop-files-from-windows-explorer_topic41792_post257752.html#257752

  • Thanks

  • Using your python example, i can drag a picture file into the window and use the image manipulator to load the image, but the the Frame rate drops to about 20 if i dont include an event to stop the 'Loop'.

    + picture: picture overlaps frame

    -> Wait: Delay 100 ms

    -> ImageManipulator: Load image Text.Text

    -> Wait: Delay 100 ms

    -> ImageManipulator: Resize to 128 x 128

    -> Wait: Delay 100 ms

    -> ImageManipulator: Copy image to sprite picture

    -> Wait: Delay 100 ms

    -> frame: Destroy ( I HAVE TO INCLUDE AN EVENT TO STOP THE 'LOOP')

    I can get it to work if i drag the image into the window, drop it and then drag it again.

    Hope this makes sense?

    I have included the cap Here

  • I wondered if anybody could look at the above problem ? (posted 9/Aug)

    Could really do with a solution.

    Thanks in advance <img src="smileys/smiley19.gif" border="0" align="middle" />

  • You want to be able to drag the images only on the frame object, right?

    This should do it:

    + Text: [negated] Text is "" (case: No)

       + System: frame at (MouseX,MouseY)

       -> ImageManipulator: Load image Text.Text

       -> ImageManipulator: Resize to 128 x 128

       -> ImageManipulator: Copy image to sprite picture

       + System: Always (every tick)

       -> Text: Set text to ""

    I haven't found a way to get the file location before the file is dropped, so you can't have the image previewing before the drop.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You want to be able to drag the images only on the frame object, right?

    This should do it:

    + Text: [negated] Text is "" (case: No)

       + System: frame at (MouseX,MouseY)

       -> ImageManipulator: Load image Text.Text

       -> ImageManipulator: Resize to 128 x 128

       -> ImageManipulator: Copy image to sprite picture

       + System: Always (every tick)

       -> Text: Set text to ""

    I haven't found a way to get the file location before the file is dropped, so you can't have the image previewing before the drop.

    ---------------------------------------------------------

    Thanks for the reply

    "You want to be able to drag the images only on the frame object, right?"

    No........The frame object doesnt need to be there. I just added it just to help me solve my problem?

    Basically i want to do the following :

    1, Run the app

    2, Drag a image file into the app window.

    3, On drop, the image manipulator loads and displays the image.

    I created the following events:

    + picture: picture overlaps frame

    -> Wait: Delay 100 ms

    -> ImageManipulator: Load image Text.Text

    -> Wait: Delay 100 ms

    -> ImageManipulator: Resize to 128 x 128

    -> Wait: Delay 100 ms

    -> ImageManipulator: Copy image to sprite picture

    ON DROP..... the image loads OK...........................BUT THE FRAMERATE DROPS (AND STAYS) AT 20 FPS.

    Adding " -> frame: Destroy " as a FINAL EVENT stops the Framerate drop (it must stop a loop ?)

    Am i making sense ?

    --------------------------------------------------------

    "I haven't found a way to get the file location before the file is dropped, so you can't have the image previewing before the drop"

    This part not a problem.

    <img src="smileys/smiley5.gif" border="0" align="middle" />

  • Ok gotcha,

    The framerate is dropping because the image is being loaded continually. Adding a "trigger once" to your condition will fix it so that the image is loaded only once every time picture overlaps frame. You could also just use "on collision" instead of "is overlapping". Also the wait actions are not necessary it will work fine without them.

  • Ok gotcha,

    The framerate is dropping because the image is being loaded continually. Adding a "trigger once" to your condition will fix it so that the image is loaded only once every time picture overlaps frame. You could also just use "on collision" instead of "is overlapping". Also the wait actions are not necessary it will work fine without them.

    -------------------------------

    Already tried all the above before i intoduced the frame?

    It wont load the first image(takes about 3 tries)

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