Time library (PE.Time)
PE.Time.TimeCounter
class usage:
kind of time.sleep or pygame.time.wait but without stopping the program.
TimeCounter.__init__(self, dur: float)
function actions:
Initializing TimeCounter
​
parameters:
dur - amount of time to wait in seconds (float)
TimeCounter.__bool__(self)
function actions:
check if the timer done.
​
returns:
is the enough time passed (bool)
TimeCounter.reset(self, dur=None)
function actions:
Reset the timer. put None in dur to use the last dur.
​
parameters:
dur - amount of time to wait in seconds (float/None)
​
​
PE.Time.AnimatedFloat
class usage:
animate a float value, can be useful for animations
AnimatedFloat.__init__(self, start: float, end: float, dur=1)
parameters:
start - the starting number (float)
end - target number (float)
dur - duration of time, the length of the animation in seconds (float)
AnimatedFloat.__float__(self) || AnimatedFloat.__int__(self)
functions actions:
when AnimatedFloat called as float/int, it calculates the current value, turns it into float/int and returns it.
​
returns:
current value (float/int)
AnimatedFloat.get_value(self)
function actions:
calculate and return current value
​
returns:
current value (float)
AnimatedFloat.reset(self)
function actions:
reset animation to default value and run again.
​
​
PE.Time.AnimatedIndex
class usage:
make animation of iterable type indexes. can be used in text animations
AnimatedIndex.__init__(self, ind, dur=1)
function actions:
Initializing AnimatedIndex
​
parameters:
ind - the iterable object (iterable object)
dur - duration of the animation in seconds (float)
AnimatedIndex.get_value(self)
function actions:
get animation value
​
returns:
animation value (any)
AnimatedIndex.reset(self)
function actions:
reset animation to default value and run again.
