frokenstein Posted June 14, 2015 Share Posted June 14, 2015 What is the simplest way to do this? Right now I am binding a function whenever the mouse is clicked:game.input.onDown.add(this.clickOnItem, this);This function figures out the x,y location of the click but what is the easiest way to determine if it is above a particular icon? Do I need to write an overlap function for every single icon it may overlap/collide with? Link to comment Share on other sites More sharing options...
marein Posted June 14, 2015 Share Posted June 14, 2015 Hello frokenstein, I think this example fit your needs https://phaser.io/examples/v2/input/button-open-popup. Take a look at the button object. Link to comment Share on other sites More sharing options...
frokenstein Posted June 15, 2015 Author Share Posted June 15, 2015 Figured it out.this.engineBuyIcon.inputEnabled = true;this.engineBuyIcon.events.onInputDown.add(this.buyItem, this); Link to comment Share on other sites More sharing options...
Recommended Posts