From b0daf314a7234cf38718c04367f125af9a822215 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 4 Nov 2025 15:58:14 -0600 Subject: [PATCH] allow making text with overriden, out-of-layout position --- src/kiss_flixel/SimpleWindow.kiss | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/kiss_flixel/SimpleWindow.kiss b/src/kiss_flixel/SimpleWindow.kiss index cdc02bf..1eb890d 100644 --- a/src/kiss_flixel/SimpleWindow.kiss +++ b/src/kiss_flixel/SimpleWindow.kiss @@ -541,17 +541,22 @@ (prop :Map _tooltips (new Map)) (prop :Map _colors (new Map)) (prop &mut :Bool selectFirstInteractiveControl true) -(method &private makeText [:String text &opt :FlxColor color :Action onClick :Action onSelect :Action onDeselect :Bool noShortcut :FlxColor bgColor :Int margin :String tooltipText :Map altActions] +(method &private makeText [:String text &opt :FlxColor color :Action onClick :Action onSelect :Action onDeselect :Bool noShortcut :FlxColor bgColor :Int margin :String tooltipText :Map altActions :FlxPoint overridePosition] (let [:FlxSprite ftext (if bgColor (let [p (SpriteTools.textPlate text textSize (or margin 0) color bgColor)] (set p.x nextControlX) (set p.y nextControlY) p) - (new FlxText nextControlX nextControlY 0 text textSize))] + (new FlxText + (if overridePosition overridePosition.x nextControlX) + (if overridePosition overridePosition.y nextControlY) + 0 + text + textSize))] (set ftext.color (or color textColor)) (dictSet _colors ftext ftext.color) - (addControl ftext) + (addControl ftext ?overridePosition) (when onSelect (dictSet _onSelectEvents ftext onSelect)) (when onDeselect