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
Copy file name to clipboardExpand all lines: src/TimeHandlr/README.md
+23-27
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
EventHandlr.js
1
+
TimeHandlr.js
2
2
==============
3
3
4
-
A timed events library derived from Full Screen Mario
5
-
This has two functions:
4
+
A timed events library derived from Full Screen Mario. It keeps a listing of functions to execute at certain timeouts and intervals, separate from Javascript's native methods.
5
+
This has two primary applications:
6
6
<ol>
7
7
<li>Provide a flexible alternative to setTimeout and setInterval that respects pauses and resumes in time (such as from game pauses)</li>
8
8
<li>Provide functions to automatically 'cycle' between certain classes on an object</li>
@@ -26,7 +26,7 @@ Essential Functions
26
26
window.MyEventHandler = new EventHandlr();</code><br /><code>
<p>Will run the <code>function</code> in <code>time_delay</code> ticks, passing any given arguments. This is equivalent to <code>setTimeout(function)</code>.</p>
<p>Will run the <code>function</code> in <code>time_delay</code> ticks a <code>num_repeats</code> number of times, passing any given arguments. <code>num_repeats</code> may be a function to evaluate or a typical number. This is equivalent to <code>setInterval(function)</code>.</p>
@@ -145,8 +145,7 @@ Essential Functions
145
145
</tr>
146
146
147
147
<tr>
148
-
<td><h3>clearEvent</h3></td>
149
-
<td>
148
+
<td><h3>clearEvent</h3>
150
149
<code><strong>clearEvent</strong>(event);</code>
151
150
</td>
152
151
<td>
@@ -159,8 +158,7 @@ Essential Functions
159
158
</tr>
160
159
161
160
<tr>
162
-
<td><h3>clearAllEvents</h3></td>
163
-
<td>
161
+
<td><h3>clearAllEvents</h3>
164
162
<code><strong>clearAllEvents</strong>();</code>
165
163
</td>
166
164
<td>
@@ -190,9 +188,10 @@ Class Cycling
190
188
<code>
191
189
window.MyEventHandler = new EventHandlr();</code><br /><code>
192
190
var me = { className: "myclass", doSpriteCycleStart: true};</code><br /><code>
191
+
var log = function log = console.log.bind(console);</code><br /><code>
<p>Initializes a cycle of <code>.className</code>s for an object. The object will continuously cycle through them until <code>clearAllCycles</code> or <code>clearClassCycle</code> are called.</p>
0 commit comments