allow set color in writeOnSprite
This commit is contained in:
@@ -36,5 +36,8 @@
|
|||||||
(canvas.stamp stamp x y)))
|
(canvas.stamp stamp x y)))
|
||||||
|
|
||||||
// TODO allow specifying size relative to canvas
|
// TODO allow specifying size relative to canvas
|
||||||
(function :Void writeOnSprite [:String text :Int size :FlxSprite canvas :RelativePosition pos]
|
(function :Void writeOnSprite [:String text :Int size :FlxSprite canvas :RelativePosition pos &opt :FlxColor color]
|
||||||
(drawOnSprite (new FlxText 0 0 0 text size) canvas pos))
|
(let [text (new FlxText 0 0 0 text size)]
|
||||||
|
(when color
|
||||||
|
(set text.color color))
|
||||||
|
(drawOnSprite text canvas pos)))
|
Reference in New Issue
Block a user