Search the Community
Showing results for tags 'pixelperfectover'.
-
Hey Phaser's, I'm having a problem were I am setting up input events on a sprite and if I turn on pixelPerfectOver then I get a nasty crash when I touch the sprite: "Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data." This does not happen with loading assets, so its not a loading issue which all web search results of this error indicate. My access is given in htaccess file. There is no problem if I turn pixelPerfectOver off. The pixelPerfectOver setting is the source of this issue. The following example is modified from my source to cut out the unrelated fat. function PurchaseView() { this.purchaseCmp_group = game.add.group(); var i, iTot, bPosX = [35, 265, 35, 265], bPosY = [75, 75, 305, 305], cBtn; iTot = bPosX.length; for (i=0;i<iTot;i++) { cBtn = game.add.sprite(bPosX, bPosY, 'BuyCards', 'BuyCard'+(i+1)+'.png', this.purchaseCmp_group); cBtn.inputEnabled = true; cBtn.input.pixelPerfectOver = true; // <-- commenting out this line will remove the error cBtn.input.useHandCursor = true; cBtn.events.onInputUp.add(this.btnUp, this); this.cardSelAr.push(cBtn); } }; PurchaseView.prototype.btnUp = function(sprite, pointer, isOver) { if (isOver) { console.log('Correctly Touched'); } };