Skip to content

Commit ec4d328

Browse files
committed
Count active pointers
1 parent 5a380fd commit ec4d328

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils/Debug.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ Phaser.Utils.Debug.prototype = {
675675
var pointers = input.pointers;
676676
var mousePointer = input.mousePointer;
677677
var modes = Phaser.PointerModes;
678+
var active = 0;
679+
var free = 0;
678680

679681
this.line('Pointers: (Max: ' + input.maxPointers + ')');
680682
this.line(' ' + (mousePointer.isDown ? 'x' : 'o') + ' ' + modes[mousePointer.pointerMode] + ' ' + mousePointer.identifier);
@@ -684,8 +686,12 @@ Phaser.Utils.Debug.prototype = {
684686
var p = pointers[i];
685687

686688
this.line(' ' + (p.active ? '+' : '-') + ' ' + modes[p.pointerMode] + ' ' + p.identifier);
689+
690+
if (p.active) { active += 1; } else { free += 1; }
687691
}
688692

693+
this.line('Active: ' + active + ' Free: ' + free);
694+
689695
this.stop();
690696

691697
},

0 commit comments

Comments
 (0)