simplegui_lib_fps — class to calculate and display Frames Per Second
(Version saved in CodeSkulptor https://py3.codeskulptor.org/#user305_tXfH4AcbNLtjfHy.py .)
Examples of use in :
test/test_image.py: https://py3.codeskulptor.org/#user306_Z5qiKFLrvKnOV1i.py
example/Spaceship_prototype.py: https://py3.codeskulptor.org/#user305_oBWI7SgNVos3Lgx.py
example/RiceRocks_Asteroids.py: https://py3.codeskulptor.org/#user305_XNvcqTxIBngtHPu.py
simplegui_lib_fps module.
A class to calculate and display FPS (Frames Per Second) in SimpleGUI of CodeSkulptor.
Piece of SimpleGUICS2Pygame. https://bitbucket.org/OPiMedia/simpleguics2pygame
- license
GPLv3 — Copyright (C) 2013-2014, 2020 Olivier Pirson
- author
Olivier Pirson — http://www.opimedia.be/
- version
May 19, 2020
- class SimpleGUICS2Pygame.simplegui_lib_fps.FPS(x: Union[int, float] = 10, y: Union[int, float] = 10, font_color: str = 'Red', font_size: int = 40)[source]
Calculate and display FPS (Frames Per Second).
How to use:
Create an instance of FPS:
fps = FPS()
Start:
fps.start()
And put the
draw_fct()
in the end of your canvas’ draw handler:fps.draw_fct(canvas)
- __init__(x: Union[int, float] = 10, y: Union[int, float] = 10, font_color: str = 'Red', font_size: int = 40) None [source]
Set an instance to calculate FPS and drawing on position (x, y).
- Parameters
x – int or float
y – int or float
font_color – str
font_size – int > 0
- __weakref__
list of weak references to the object (if defined)
[source]