mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
parent
8e65618e3c
commit
f00de3c0a4
@ -38,10 +38,6 @@ Creates a new timer instance that is independent of the global timer: It will
|
||||
manage it's own list of scheduled functions and does not in any way affect the
|
||||
the global timer. Likewise, the global timer does not affect timer instances.
|
||||
|
||||
.. note::
|
||||
Unlike the global instance, timer instaces need the colon sytax, i.e.
|
||||
``instance:after()``) instead of ``Timer.after()``.
|
||||
|
||||
.. note::
|
||||
If you don't need multiple independent schedulers, you can use the
|
||||
global/default timer (see examples).
|
||||
@ -53,8 +49,6 @@ the global timer. Likewise, the global timer does not affect timer instances.
|
||||
|
||||
.. function:: Timer.after(delay, func)
|
||||
|
||||
.. function:: instance:after(delay, func)
|
||||
|
||||
:param number delay: Number of seconds the function will be delayed.
|
||||
:param function func: The function to be delayed.
|
||||
:returns: The timer handle. See also :func:`Timer.cancel`.
|
||||
@ -90,8 +84,6 @@ periodic behavior (see the example).
|
||||
|
||||
.. function:: Timer.every(delay, func[, count])
|
||||
|
||||
.. function:: instance:every(delay, func[, count])
|
||||
|
||||
:param number delay: Number of seconds between two consecutive function calls.
|
||||
:param function func: The function to be called periodically.
|
||||
:param number count: Number of times the function is to be called (optional).
|
||||
@ -124,8 +116,6 @@ or :func:`Timer.cancel` or :func:`Timer.clear` is called on the timer instance.
|
||||
|
||||
.. function:: Timer.during(delay, func[, after])
|
||||
|
||||
.. function:: instance:during(delay, func[, after])
|
||||
|
||||
:param number delay: Number of seconds the func will be called.
|
||||
:param function func: The function to be called on ``update(dt)``.
|
||||
:param function after: A function to be called after delay seconds (optional).
|
||||
@ -175,8 +165,6 @@ seconds have passed.
|
||||
|
||||
.. function:: Timer.cancel(handle)
|
||||
|
||||
.. function:: instance:cancel(handle)
|
||||
|
||||
:param table handle: The function to be canceled.
|
||||
|
||||
Prevent a timer from being executed in the future.
|
||||
@ -203,8 +191,6 @@ Prevent a timer from being executed in the future.
|
||||
|
||||
.. function:: Timer.clear()
|
||||
|
||||
.. function:: instance:clear()
|
||||
|
||||
Remove all timed and periodic functions. Functions that have not yet been
|
||||
executed will discarded.
|
||||
|
||||
@ -214,7 +200,7 @@ executed will discarded.
|
||||
|
||||
::
|
||||
|
||||
menuTimer:clear()
|
||||
menu_timer:clear()
|
||||
|
||||
|
||||
.. function:: Timer.update(dt)
|
||||
@ -241,8 +227,6 @@ Update timers and execute functions if the deadline is reached. Call in
|
||||
|
||||
.. function:: Timer.tween(duration, subject, target, method, after, ...)
|
||||
|
||||
.. function:: instance:tween(duration, subject, target, method, after, ...)
|
||||
|
||||
:param number duration: Duration of the tween.
|
||||
:param table subject: Object to be tweened.
|
||||
:param table target: Target values.
|
||||
|
Loading…
Reference in New Issue
Block a user