mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 19:12:31 +08:00
* Debug mode to be variable on BaseGame * Update debug mode docs * Fix typo Co-authored-by: Erick <erickzanardoo@gmail.com>
895 B
895 B
Debug features
FPS counter
Flame provides the FPSCounter mixin for recording the fps, this mixin can be applied on any class that extends from Game. When applied you have to implemented the recordFps method and it should return true if you want to access the current fps by using the fps method`.
class MyGame extends Game with FPS {
@override
bool recordFps() => true;
}
BaseGame features
Flame provides some features for debugging, these features are enabled when the debugMode from the BaseGame class is set to true (or overridden to be true).
When it's enabled all PositionComponents will be wrapped into a rectangle, and have its position rendered on the screen, so you can visually verify the component boundaries and position.
To see a working example of the debugging features of the BaseGame, check this example.