Jump to content

right click event


roxor45
 Share

Recommended Posts

function onDragEnd(e) {
  console.log(e); // your event debug , look in chrome debug.
    this.alpha = 1;
    this.dragging = false;
    // set the interaction data to null
    this.data = null;
   e.data.button === 2 && e.currentTarget.parent.removeChild(e.currentTarget); // delete 
}



// optional, prevent right click contextBox
document.addEventListener('contextmenu', e => {
   e.preventDefault();
}); 

Replace by this, if you click Right, the sprite will delete, you need add `argument` to the method, i add for you a console.log(e) to understand what you get from event.

I suggest you to remove your porn avatar ! you are on public dev support forum, and there may be minor children who consult the site !
I do not do the rules, but a modo could warn you.

Link to comment
Share on other sites

23 minutes ago, jonforum said:

I suggest you to remove your porn avatar ! you are on public dev support forum, and there may be minor children who consult the site !
I do not do the rules, but a modo could warn you.

lol don't worry , it's not a porn avatar :) it's an avatar from my google account , so no pb i change that .

back to Js

I try that and I come back ! thanks !!!

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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