Jump to content

phaser , Circle button


skywalker
 Share

Recommended Posts

im trying to make a circle button with tap event i used hitArea property from sprite class and using pixi Circle class i did that

 

this.sprite = game.add.sprite(50,50,"cursors");

this.sprite.anchor.set(0.5,0.5);

this.sprite.hitArea = new PIXI.Circle(50,50,84);

this.sprite.inputEnabled = true;

this.sprite.events.onInputDown.add(function(){

console.log("clicked");
});

};

 

it is not working at all so i tried removing this.sprite.anchor.set(0.5,0.5);

input is work fine when there is no hit Area so what should i do

note : phaser version is 2.2.2

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...