mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-01 01:18:38 +08:00 
			
		
		
		
	Abstracting text API to enable custom renderers (#772)
* Abstracting text API to enable custom renderers * Addressing comments * Lint * Update doc/text.md Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com> * Adding dartdoc about TextRenderer Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
This commit is contained in:
		| @ -34,7 +34,11 @@ class LogoCompomnent extends SpriteComponent with HasGameRef<DebugGame> { | ||||
| } | ||||
|  | ||||
| class DebugGame extends BaseGame { | ||||
|   static final fpsTextConfig = TextConfig(color: const Color(0xFFFFFFFF)); | ||||
|   static final fpsTextPaint = TextPaint( | ||||
|     config: const TextPaintConfig( | ||||
|       color: Color(0xFFFFFFFF), | ||||
|     ), | ||||
|   ); | ||||
|  | ||||
|   @override | ||||
|   bool debugMode = true; | ||||
| @ -67,7 +71,7 @@ class DebugGame extends BaseGame { | ||||
|     super.render(canvas); | ||||
|  | ||||
|     if (debugMode) { | ||||
|       fpsTextConfig.render(canvas, fps(120).toString(), Vector2(0, 50)); | ||||
|       fpsTextPaint.render(canvas, fps(120).toString(), Vector2(0, 50)); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Erick
					Erick