From 07144e95cfea0f5841ed90eae62a294920e9beaa Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 2 Jan 2022 20:04:51 -0700 Subject: [PATCH] allow set color in writeOnSprite --- .../hollywoo-flixel/src/hollywoo_flixel/SpriteTools.kiss | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/hollywoo-flixel/src/hollywoo_flixel/SpriteTools.kiss b/projects/hollywoo-flixel/src/hollywoo_flixel/SpriteTools.kiss index c93b9a60..f277785e 100644 --- a/projects/hollywoo-flixel/src/hollywoo_flixel/SpriteTools.kiss +++ b/projects/hollywoo-flixel/src/hollywoo_flixel/SpriteTools.kiss @@ -36,5 +36,8 @@ (canvas.stamp stamp x y))) // TODO allow specifying size relative to canvas -(function :Void writeOnSprite [:String text :Int size :FlxSprite canvas :RelativePosition pos] - (drawOnSprite (new FlxText 0 0 0 text size) canvas pos)) \ No newline at end of file +(function :Void writeOnSprite [:String text :Int size :FlxSprite canvas :RelativePosition pos &opt :FlxColor color] + (let [text (new FlxText 0 0 0 text size)] + (when color + (set text.color color)) + (drawOnSprite text canvas pos))) \ No newline at end of file