From 5348fe4e324c72a5ce14d5e753a4e384c9438d3c Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Thu, 6 Jan 2022 12:24:26 -0700 Subject: [PATCH] put name on right of screen for right-side actors --- src/hollywoo_flixel/FlxDirector.kiss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hollywoo_flixel/FlxDirector.kiss b/src/hollywoo_flixel/FlxDirector.kiss index 317db53..d0370e7 100644 --- a/src/hollywoo_flixel/FlxDirector.kiss +++ b/src/hollywoo_flixel/FlxDirector.kiss @@ -133,8 +133,13 @@ // TODO attribute on-screen dialogue to the character's stageposition // When the actor is in the scene, check for an animation matching the wryly + // TODO allow sounds for wrylies, like the dispatch click + (localVar &mut nameOnRight false) (doFor =>actorName character currentState.characters (when (= actorName speakerName) + (case character.stagePosition + ((or Right RightBehind) (set nameOnRight true)) + (otherwise)) (let [actor (the ActorFlxSprite character.actor)] (if wryly (actor.playAnimation wryly) @@ -158,11 +163,12 @@ (-= dialogText.size 6)) // show the speaker name (unless speakerNameText - (set speakerNameText (new FlxText DIALOG_X DIALOG_Y DIALOG_WIDTH "" DIALOG_SIZE))) + (set speakerNameText (new FlxText DIALOG_X DIALOG_Y 0 "" DIALOG_SIZE))) (currentState.add speakerNameText) (if speakerName { (set speakerNameText.text "${speakerName}:") + (set speakerNameText.x (if nameOnRight (- (+ DIALOG_X DIALOG_WIDTH) speakerNameText.fieldWidth) DIALOG_X)) (speakerNameText.revive) (set dialogText.y (+ DIALOG_Y speakerNameText.height)) }