roxor45 Posted March 22, 2019 Share Posted March 22, 2019 hello all, actually i try a lot of example from pixi , And I try to catch right click for delete sprite from bunny example : https://pixijs.io/examples/#/demos/dragging.js So it's possible to get right click event ? how to do that ? do you have an example ? thanks and good day Quote Link to comment Share on other sites More sharing options...
jonforum Posted March 22, 2019 Share Posted March 22, 2019 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. Quote Link to comment Share on other sites More sharing options...
jonforum Posted March 22, 2019 Share Posted March 22, 2019 note that the console debug will indicate some missing information in the console. To debug with more precision it necessary to use breakPoint. The information in the console will be obsolete because they are compute only when you open the debug objet and can mislead you. roxor45 1 Quote Link to comment Share on other sites More sharing options...
roxor45 Posted March 22, 2019 Author Share Posted March 22, 2019 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 !!! jonforum 1 Quote Link to comment Share on other sites More sharing options...
roxor45 Posted March 22, 2019 Author Share Posted March 22, 2019 OUHA , very very nice, Many thanks ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.