OpenGLContext.events.internaltime
Track a (potentially scaled) time with respect to an external time
Classes
class InternalTime(
object
):
Track an internal time.
Internal times allow for fractional and absolute reporting
of a current time with a given duration. The internal time
potentially has a transformation applied to the incoming time
values, which allows for time reversal, slowdown and speed up.
__init__(
self
,
duration
= 1.0
,
repeating
= 0
,
multiplier
= 1.0
,
current
= None
,
currentCount
= None
,
discreteOnly
= 0
)
Initialise (but don't start) the timer
- duration
- length in seconds (float) for a single cycle
- repeating
- if 1, will not stop when hit duration, but will repeat forever elif positive count > 1, will repeat X times duration
- multiplier
- the time multiplier 1.0 -> real-time, .1 -> slow-mo, -1.0 -> rewind
- current
- current internal time, lets you start at other than 0 seconds use resume to do the restarting
- currentCount
- the current count for repeats, lets you start partway through the set
- discreteOnly
- suppress the generation of fractional events...
_resetCurrent(
self
,
restart
= 1
)
Reset the current cycle
- restart
- whether to return to the start of the cycle, or merely to reset the overall cycle count
getCurrent(
self
)
Get current internal time
You could pass this to another internal time
that's dependent on this time as "realTime"
pause(
self
,
realTime
)
Pause the timer, use resume to continue
Note: does not create a FractionalEvent