From 2bebb05edb85a997c69b6fd47b3cbc558777b4af Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 29 Dec 2021 18:16:47 -0700 Subject: [PATCH] position props better --- src/hollywoo_flixel/FlxDirector.kiss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hollywoo_flixel/FlxDirector.kiss b/src/hollywoo_flixel/FlxDirector.kiss index a7b0260..24795dc 100644 --- a/src/hollywoo_flixel/FlxDirector.kiss +++ b/src/hollywoo_flixel/FlxDirector.kiss @@ -159,9 +159,20 @@ (otherwise (throw "not implemented")))] (let [width (min (max prop.width PROP_MIN_WIDTH) PROP_MAX_WIDTH)] (prop.setGraphicSize width) + (prop.updateHitbox) + // if the prop is too tall, shrink it heightwise + (when (> prop.height DIALOG_Y) + (prop.setGraphicSize 0 DIALOG_Y) + (prop.updateHitbox)) + (set prop.x (- x (/ prop.width 2))) (set prop.y (- y (/ prop.height 2))) + // if the prop would block the dialogue box, bump it up + (let [propBottom (+ prop.y prop.height)] + (when (> propBottom DIALOG_Y) + (-= prop.y (- propBottom DIALOG_Y)))) + (currentState.add prop))) // TODO give the prop reveal some time to land (cc))