Skip to content

Commit 6456ef1

Browse files
committed
Touch pointer total fix
The InputManager would only create 1 Pointer, even if Touch input was enabled in the config, which meant you couldn't use touch events unless you first called `addPointer` or specified one in the config. Now, it Touch is enabled in the config, it'll always create 2 pointers by default.
1 parent 3914863 commit 6456ef1

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## Version 3.10.1 - Hayashi - 13th June 2018
4+
5+
### Bug Fixes
6+
7+
* The InputManager would only create 1 Pointer, even if Touch input was enabled in the config, which meant you couldn't use touch events unless you first called `addPointer` or specified one in the config. Now, it Touch is enabled in the config, it'll always create 2 pointers by default.
8+
39
## Version 3.10.0 - Hayashi - 13th June 2018
410

511
### Input System New Features + Updates

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phaser",
3-
"version": "3.10.0",
3+
"version": "3.10.1",
44
"release": "Hayashi",
55
"description": "A fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.",
66
"author": "Richard Davey <rich@photonstorm.com> (http://www.photonstorm.com)",

src/const.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var CONST = {
2020
* @type {string}
2121
* @since 3.0.0
2222
*/
23-
VERSION: '3.10.0',
23+
VERSION: '3.10.1',
2424

2525
BlendModes: require('./renderer/BlendModes'),
2626

src/input/InputManager.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ var InputManager = new Class({
219219
*/
220220
this.pointersTotal = config.inputActivePointers;
221221

222+
if (config.inputTouch && this.pointersTotal === 1)
223+
{
224+
this.pointersTotal = 2;
225+
}
226+
222227
for (var i = 0; i <= this.pointersTotal; i++)
223228
{
224229
this.pointers.push(new Pointer(this, i));

0 commit comments

Comments
 (0)