jonigiuro Posted April 28, 2016 Share Posted April 28, 2016 Hi, my click events aren't working in any version of ie and I can't really find a solution for it. The curious thing is that if I swap my mousedown with a mousemove it works, meaning the events get into the pixijs canvas correctly, but in my project the mousemove is not an option Here's the relevant code: Thank you for every help var isTouchDevice = $('html').hasClass('touch'); // This function gets called from somewhere else var new_word = getRandomWord(); var color = new_word == currentWord ? 0xffffff : 0xffffff; var fontSize = isSmallScreen ? Math.round(Math.random() * 10 + 10) : Math.round(Math.random() * 40 + 20); var creationPadding = isSmallScreen ? 0 : 200; var text = new PIXI.Text(new_word, { font: fontSize + 'px Clarendon', fill: color, dropShadow: !isTouchDevice, dropShadowColor: 0xffffff, dropShadowDistance: 0, dropShadowBlur: 8, dropShadowAlpha: .2, padding: 5, align: 'left' }); text.pivot.set(text.width / 2, text.height / 2); text.position.x = getRandomArbitrary(creationPadding, renderer.width - creationPadding); text.position.y = getRandomArbitrary(0, renderer.height - beer.position.y - 156); text.rotation = degToRad(getRandomArbitrary(-20, 20)); text.interactive = true; currentlyShownWords.push(text._text); if (isTouchDevice) { text.on('touchstart', function (e) { alert('touch'); if (inGame) { e.stopPropagation(); if (text._text == currentWord) { clickedCorrectWord(text); } else { clickedWrongWord(text); } } }); } else { text.on('mousedown', function (e) { alert('mousedown'); if (inGame) { e.stopPropagation(); if (text._text == currentWord) { clickedCorrectWord(text); } else { clickedWrongWord(text); } } }); text.filters = [displacementFilter]; // filters only on NON touch devices for performance reasons } Quote Link to comment Share on other sites More sharing options...
jonigiuro Posted April 29, 2016 Author Share Posted April 29, 2016 There was a conflict with another js file. It was REALLY hard to find. Anyway, we're good here, this can be removed. 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.