From a0e65fb4c1f6f573ab5af999c4af8f1274991ae7 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 10 Jan 2022 13:57:13 -0700 Subject: [PATCH] bump props up when quickAdd to the lower half of screen --- .../src/hollywoo_flixel/FlxDirector.kiss | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.kiss b/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.kiss index 37bb69c7..0de642e0 100644 --- a/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.kiss +++ b/projects/hollywoo-flixel/src/hollywoo_flixel/FlxDirector.kiss @@ -290,11 +290,19 @@ (set prop.x (- x (/ prop.width 2))) (set prop.y (- y (/ prop.height 2))) - // if a prop meant to be centered would block the dialogue box, bump it up - (whenLet [Center position] - (let [propBottom (+ prop.y prop.height)] - (when (> propBottom DIALOG_Y) - (-= prop.y (- propBottom DIALOG_Y))))) + + (let [propBottom (+ prop.y prop.height)] + (case position + // if a prop meant to be centered would block the dialogue box, bump it up + (Center + (when (> propBottom DIALOG_Y) + (-= prop.y (- propBottom DIALOG_Y)))) + // If a prop meant to be on the lower half of the screen goes below the edge, bring it up + ((or LowerLeft LowerCenter LowerRight) + (when (> propBottom FlxG.height) + (-= prop.y (- propBottom FlxG.height)))) + (otherwise))) + (currentState.add prop))) (cc))