File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -277,6 +277,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
277277* Time.update has been streamlined and the ` updateSetTimeout ` and ` updateRAF ` methods merged and duplicate code removed.
278278* Time.desiredFpsMult is a pre-calculated multiplier used in Game.update.
279279* Time.refresh updates the ` Time.time ` and ` Time.elapsedMS ` values and is called automatically by Game.update.
280+ * DeviceButton was setting a ` duration ` property on itself, which went against the read only getter of duration (thanks @winstonwolff )
280281
281282### Bug Fixes
282283
Original file line number Diff line number Diff line change @@ -64,15 +64,6 @@ Phaser.DeviceButton = function (parent, buttonCode) {
6464 */
6565 this . timeDown = 0 ;
6666
67- /**
68- * If the button is down this value holds the duration of that button press and is constantly updated.
69- * If the button is up it holds the duration of the previous down session.
70- * The value is stored in milliseconds.
71- * @property {number } duration
72- * @default
73- */
74- this . duration = 0 ;
75-
7667 /**
7768 * @property {number } timeUp - The timestamp when the button was last released.
7869 * @default
@@ -169,7 +160,6 @@ Phaser.DeviceButton.prototype = {
169160 this . isDown = true ;
170161 this . isUp = false ;
171162 this . timeDown = this . game . time . time ;
172- this . duration = 0 ;
173163 this . repeats = 0 ;
174164
175165 this . event = event ;
@@ -278,7 +268,6 @@ Phaser.DeviceButton.prototype = {
278268 this . isUp = true ;
279269
280270 this . timeDown = this . game . time . time ;
281- this . duration = 0 ;
282271 this . repeats = 0 ;
283272
284273 this . altKey = false ;
@@ -309,7 +298,7 @@ Phaser.DeviceButton.prototype = {
309298Phaser . DeviceButton . prototype . constructor = Phaser . DeviceButton ;
310299
311300/**
312- * How long the button has been held down.
301+ * How long the button has been held down for in milliseconds .
313302* If not currently down it returns -1.
314303*
315304* @name Phaser.DeviceButton#duration
You can’t perform that action at this time.
0 commit comments