The root library (PE)
PE.init(win_size=(1920, 1080), max_frame_rate=30)
function actions:
Initializing pygame, updating resolution, updating max framerate.
​
recommended place on script:
The head of the script
​
parameters:
win_size - the window render resolution (vector 2)
max_frame_rate - the maximum render frame rate (float)
PE.events()
This is the main PE's tick function.
​
function actions:
Updating events, automatically close the program on quit event (F4 or X button), getting and setting frame rate, updating delta-time counter.
​
recommended place on script:
The head of the main loop.
​
returns:
list of pygame events (better option: PE.last_events variable includes events list too, without ticking several ticks at once) (list)
PE.get_fps()
Old version of PE.fps. Use PE.fps in order to save CPU time.
​
function actions:
calculating current fps.
​
returns:
current fps (float)
PE.delta_time()
function actions:
Calculate the time that passed from last frame (PE.events() call) in milliseconds.
​
returns:
delta time in milliseconds (int)
​
​
PE.PE_version
Current PE version
​
variable usage:
Get current PE version
​
type:
str
PE.clock
PE pygame clock
​
variable usage:
no-user use, used by PE.events() fps correcting and counter, used by PE.get_fps() fps counter.
​
type:
pygame.time.Clock
​
PE.fps
Current fps.
​
variable usage:
get current fps without CPU computing, used by PE.events() fps counter
​
type:
float
PE.max_fps
Get current max fps
​
variable usage:
get the last max_fps parameter that set by PE.init(), used by PE.init(), used by PE.events().
​
type:
float
PE.last_events_update
Get last PE.events() call in milliseconds
​
variable usage:
no-user usage, used by PE.events(), used by PE.delta_time()
​
type;
int
PE.exit_func
Set the quit function, runes on the last frame.
​
variable usage:
set quit function or None for nothing, used by PE.events() quit event.
​
type:
function/None
