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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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