You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Device.quirksMode is a boolean that informs you if the page is in strict (false) or quirks (true) mode.
Canvas.getOffset now runs a strict/quirks check and uses document.documentElement when calculating scrollTop and scrollLeft to avoid Chrome console warnings.
The Time class now has three new methods: addEvent, repeatEvent and loopEvent. See the new Timer examples to show how to use them.
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,9 @@ Updates:
130
130
* Added in prototype.constructor definitions to every class (thanks darkoverlordofdata)
131
131
* Group.destroy has a new parameter: destroyChildren (boolean) which will optionally call the destroy method of all Group children.
132
132
* Button.clearFrames method has been added.
133
+
* Device.quirksMode is a boolean that informs you if the page is in strict (false) or quirks (true) mode.
134
+
* Canvas.getOffset now runs a strict/quirks check and uses document.documentElement when calculating scrollTop and scrollLeft to avoid Chrome console warnings.
135
+
* The Time class now has three new methods: addEvent, repeatEvent and loopEvent. See the new Timer examples to show how to use them.
* @property {boolean} _justResumed - Internal value used to recover from the game pause state.
@@ -126,29 +126,82 @@ Phaser.Time = function (game) {
126
126
*/
127
127
this._timers=[];
128
128
129
+
// Listen for game pause/resume events
130
+
this.game.onPause.add(this.gamePaused,this);
131
+
this.game.onResume.add(this.gameResumed,this);
132
+
129
133
};
130
134
131
135
Phaser.Time.prototype={
132
136
137
+
/**
138
+
* @method Phaser.Time#boot
139
+
*/
140
+
boot: function(){
133
141
142
+
this._timer.start();
143
+
144
+
},
145
+
146
+
/**
147
+
* Adds a new Event to this Timer. The event will fire after the given amount of 'delay' in milliseconds has passed, once the Timer has started running.
148
+
* Call Timer.start() once you have added all of the Events you require for this Timer. The delay is in relation to when the Timer starts, not the time it was added.
149
+
* @method Phaser.Time#addEvent
150
+
* @param {number} delay - The number of milliseconds that should elapse before the Timer will call the given callback.
151
+
* @param {function} callback - The callback that will be called when the Timer event occurs.
152
+
* @param {object} callbackContext - The context in which the callback will be called.
153
+
* @param {...} arguments - The values to be sent to your callback function when it is called.
* Adds a new Event to this Timer that will repeat for the given number of iterations.
163
+
* The event will fire after the given amount of 'delay' milliseconds has passed once the Timer has started running.
164
+
* Call Timer.start() once you have added all of the Events you require for this Timer. The delay is in relation to when the Timer starts, not the time it was added.
165
+
* @method Phaser.Time#repeatEvent
166
+
* @param {number} delay - The number of milliseconds that should elapse before the Timer will call the given callback.
167
+
* @param {number} repeatCount - The number of times to repeat the event.
168
+
* @param {function} callback - The callback that will be called when the Timer event occurs.
169
+
* @param {object} callbackContext - The context in which the callback will be called.
170
+
* @param {...} arguments - The values to be sent to your callback function when it is called.
* Adds a new looped Event to this Timer that will repeat forever or until the Timer is stopped.
180
+
* The event will fire after the given amount of 'delay' milliseconds has passed once the Timer has started running.
181
+
* Call Timer.start() once you have added all of the Events you require for this Timer. The delay is in relation to when the Timer starts, not the time it was added.
182
+
* @method Phaser.Time#loopEvent
183
+
* @param {number} delay - The number of milliseconds that should elapse before the Timer will call the given callback.
184
+
* @param {function} callback - The callback that will be called when the Timer event occurs.
185
+
* @param {object} callbackContext - The context in which the callback will be called.
186
+
* @param {...} arguments - The values to be sent to your callback function when it is called.
* @param {number} [timeUnit=1000] - The number of ms that represent 1 unit of time. For example a timer that ticks every second would have a timeUnit value of 1000.
139
197
* @param {boolean} [autoDestroy=true] - A Timer that is set to automatically destroy itself will do so after all of its events have been dispatched (assuming no looping events).
140
198
* @return {Phaser.Timer} The Timer object that was created.
0 commit comments