Jump to content

Drag Problem with hitArea


bymafmaf
 Share

Recommended Posts

Guys I have 3 sprites next to each other. It's a mobile game so I set their hitArea property greater than their actual size for convenience. When user places these 3 sprites onto board, then another 3 comes.

 

The problem is it works but after some point I can't drag one of sprites anymore and it gets stuck because game cannot send any new sprites if there is one or more already. I randomly try to drag and usually there is one little tiny pixel that I can use for drag.

 

So, hitArea cancels itself. Because hitArea property is set, sprites' own hitArea is null. Also I don't know why one pixel that I cannot see is able to drag it. Probably it is about pixi, I looked at their website but it is all pixi 3, whose DisplayObject doesn't even have a property called hitAra, and phaser is still using pixi 2.

 

I'm really tired of this problem and hitArea setting quirks. Please help me on this. Some code here:

this.hitArea = new Phaser.Circle(0,0,400);

"this" refers to the sprite.

 

Edit: Sprite that I set its hitArea is a parent. Actual sprites that have images are its children.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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