aatish Posted July 13, 2016 Share Posted July 13, 2016 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 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 13, 2016 Share Posted July 13, 2016 wow, thats a real bug Quote Link to comment Share on other sites More sharing options...
aatish Posted July 13, 2016 Author Share Posted July 13, 2016 Hmm.. ok, I posted it as an issue as well: https://github.com/pixijs/pixi.js/issues/2717 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 13, 2016 Share Posted July 13, 2016 Actually, thats not a bug. PIXI cant detect what is the size of your canvas, it must be exactly 1:1 with CSS pixel. If you have a way of detecting it, please tell me Quote Link to comment Share on other sites More sharing options...
aatish Posted July 13, 2016 Author Share Posted July 13, 2016 I don't understand. Could you suggest what I might try to fix it? Thanks! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 13, 2016 Share Posted July 13, 2016 resize the canvas/renderer Quote Link to comment Share on other sites More sharing options...
aatish Posted July 13, 2016 Author Share Posted July 13, 2016 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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 13, 2016 Share Posted July 13, 2016 that's a bit better Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 14, 2016 Share Posted July 14, 2016 https://github.com/pixijs/pixi.js/pull/2718 aatish 1 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.