PIXI Controls: Custom hitArea for DPAD
This commit is contained in:
parent
1dd604a661
commit
82e62f6422
2 changed files with 2 additions and 0 deletions
|
@ -57,6 +57,7 @@ ONSControls.createDPad = function() {
|
|||
container.interactive = true;
|
||||
container.pressed = false;
|
||||
container.pressed_button = null;
|
||||
container.hitArea = new PIXI.Polygon([-30,-83, 30,-83, 30,-30, 83,-30, 83,30, 30,30, 30,82, -30,82, -30,30, -83, 30, -83,-30, -30,-30]);
|
||||
container.down = function(x, y) {
|
||||
if (Math.abs(x) > container.width / 2 || Math.abs(y) > container.height / 2) {
|
||||
return; // Pointer out of dpad, ignoring event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue