justinboyd5 Posted December 29, 2015 Share Posted December 29, 2015 Hey Everyone,I hope someone could help me with this, or if anyone has run into this issue before. I've noticed when I add a signal to an extended sprite, it will be executed immediately. Has anyone run into this issue before? var Card = function(game, x, y, data){ Phaser.Sprite.call(this, game, x, y, 'cardFront'); this.cardName = data.cardName || null; // String this.scale.setTo(0.15,0.15);};Card.prototype = Object.create(Phaser.Sprite.prototype);Card.prototype.constructor = Card;var card = new Card(this.game, 0, 0, {name:'test'});card.input.useHandCursor = true;card.events.onInputOver.add(highlightCard, this, 0, 'arg1', 'arg2');HighlightCard = function(sprite, pointer, arg1, arg2){ console.log('highlight:', sprite, pointer, arg1, arg2);}; Thank you! Link to comment Share on other sites More sharing options...
lewster32 Posted December 30, 2015 Share Posted December 30, 2015 I'm not sure what exactly is going on, but JavaScript is case-sensitive so highlightCard and HighlightCard are not the same; is something else calling HighlightCard or is there another function called highlightCard? Link to comment Share on other sites More sharing options...
justinboyd5 Posted January 4, 2016 Author Share Posted January 4, 2016 Thanks lewster32! I found the problem I was having. The sprite I was using was huge and I was scaling it down as it gets created. Since the sprite was so large it covered the entire game world. This caused my onInputOver to trigger even when the sprite was scaled down. It's pretty minor but should I open a bug for this? Link to comment Share on other sites More sharing options...
Recommended Posts