Jump to content

Drag and drop image


Recommended Posts

I'm still a phaser beginner, so I'm not sure the following helps:

You can easily load images at runtime (see e.g. https://labs.phaser.io/edit.html?src=src\loader\image\load image on click.js) though I think they have to be in the webspace already. You could probably use any standard technology to upload an image to a given path and than load it in phaser.

Regarding the drag and drop there is functionality for this (see e.g. https://labs.phaser.io/edit.html?src=src\input\dragging\stack of cards.js). I think it should be easy to adjust this example to move the image back to its original position, if the image is on an invalid position at drag stop.

Again: I have not done any of these. Take a look at https://labs.phaser.io/index.html, it's a very valuable resource regarding any Phaser3 stuff.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...