Search the Community
Showing results for tags 'mousedown pixi interactive'.
-
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 }