]> Skullheadx's Git Forge - Pygame-Jam.git/commitdiff
Dialogue Floating Text Fix
authorlbcmk <30442978+lbcmk@users.noreply.github.com>
Tue, 12 Jul 2022 23:10:03 +0000 (19:10 -0400)
committerlbcmk <30442978+lbcmk@users.noreply.github.com>
Tue, 12 Jul 2022 23:10:03 +0000 (19:10 -0400)
Setup.py
UI/Dialogue.py

index 310061c2a0acfd2582dab58c144ca2d3419336ac..f4be3fca1f10e3a2528b6055935bdbe375b938fa 100644 (file)
--- 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
index 4421f6a7b327682fd22a94b4f2ba82876e86ddda..f890b66413dd30045dfb7475a4a99cc058cf080e 100644 (file)
@@ -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()