frokenstein Posted June 14, 2015 Report 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? Quote Link to comment Share on other sites More sharing options...
marein Posted June 14, 2015 Report 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. Quote Link to comment Share on other sites More sharing options...
frokenstein Posted June 15, 2015 Author Report Share Posted June 15, 2015 Figured it out.this.engineBuyIcon.inputEnabled = true;this.engineBuyIcon.events.onInputDown.add(this.buyItem, this); 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.