From 28377de29d9081509a6fe7a0a4032f874ff3fd05 Mon Sep 17 00:00:00 2001 From: Jochum van der Ploeg Date: Fri, 22 Apr 2022 15:41:41 +0200 Subject: [PATCH] feat: add debug information --- lib/game/pinball_game.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/game/pinball_game.dart b/lib/game/pinball_game.dart index 7d9d8c08..35a792af 100644 --- a/lib/game/pinball_game.dart +++ b/lib/game/pinball_game.dart @@ -200,14 +200,14 @@ class _DebugInformation extends Component with HasGameRef { @override PositionType get positionType => PositionType.widget; - final _debugText = TextPaint( + final _debugTextPaint = TextPaint( style: const TextStyle( color: Colors.green, fontSize: 10, ), ); - final _debugBackground = Paint()..color = Colors.white; + final _debugBackgroundPaint = Paint()..color = Colors.white; @override void render(Canvas canvas) { @@ -216,12 +216,12 @@ class _DebugInformation extends Component with HasGameRef { 'BALLS: ${gameRef.descendants().whereType().length}', ].join(' | '); - final height = _debugText.measureTextHeight(debugText); + final height = _debugTextPaint.measureTextHeight(debugText); final position = Vector2(0, gameRef.camera.canvasSize.y - height); canvas.drawRect( position & Vector2(gameRef.camera.canvasSize.x, height), - _debugBackground, + _debugBackgroundPaint, ); - _debugText.render(canvas, debugText, position); + _debugTextPaint.render(canvas, debugText, position); } }