From 63e7c5473771acab8725bdeb47e6db466821a80d Mon Sep 17 00:00:00 2001 From: lbcmk <30442978+lbcmk@users.noreply.github.com> Date: Tue, 12 Jul 2022 19:10:03 -0400 Subject: [PATCH] Dialogue Floating Text Fix --- Setup.py | 3 +++ UI/Dialogue.py | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Setup.py b/Setup.py index 310061c..f4be3fc 100644 --- a/Setup.py +++ b/Setup.py @@ -45,6 +45,9 @@ def get_display_rect(collision_rect): def get_display_point(vec): return vec - camera_offset +def get_camera_offset(): + return camera_offset + from Area import Area from PIL import Image diff --git a/UI/Dialogue.py b/UI/Dialogue.py index 4421f6a..f890b66 100644 --- a/UI/Dialogue.py +++ b/UI/Dialogue.py @@ -1,4 +1,6 @@ +from abc import get_cache_token from regex import D +from Function.WorldCoords import getWorldCoords from Setup import * from CommonImports.colours import white, black from Function.createText import createText @@ -40,14 +42,15 @@ class DialogueUI: try: X, Y = 0, 0 - if(self.dialogue_list[self.char][2][0] == -10000 or self.dialogue_list[self.char][2][1] == -10000): + if(self.dialogue_list[self.char][2][0] == -10000 and self.dialogue_list[self.char][2][1] == -10000): X = get_display_point(agent.position)[0] + agent.width / 2 Y = get_display_point(agent.position)[1] else: - X, Y = get_display_point((Xt, Yt)) - - print(get_display_point(agent.position)[0] + agent.width / 2, get_display_point(agent.position)[1]) + X, Y = get_display_point((self.dialogue_list[self.char][2][0], self.dialogue_list[self.char][2][1])) + # print(get_display_point((X, Y))) + print(get_camera_offset()[0] + SCREEN_WIDTH/2, get_camera_offset()[1] + SCREEN_HEIGHT/2) + self.text = self.dialogue_list[self.char][0] self.checkTime() self.createDialogue() -- 2.54.0