Jump to content

Unreliable mouse interaction with rope mesh


aatish
 Share

Recommended Posts

Hi, I'm trying to modify the 'strip' pixi.js example that demonstrates the rope mesh. I tried adding interactivity to the rope so that when I click it the size changes.

https://codepen.io/aatish/pen/yJPWBx

However, the click behavior seems unreliable for me. It works in some places and not in others, and I'm having trouble understanding where in the image I should be clicking for the interaction to occur. Ideally I would like the interaction behavior to happen whenever I click within the boundaries of the snake. 

Any pointers would be much appreciated.

Best,

Aatish

 

 

Link to comment
Share on other sites

Do you mean add something like:

var w = window.innerWidth;    
var h = window.innerHeight;
renderer.view.style.width = w + "px";
renderer.view.style.height = h + "px";
renderer.resize(w,h);

after creating the renderer? 

I tried that and it doesn't work. There are still many places I can click on the snake where it doesn't resize.

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