]> code.bitgloo.com Git - clyne/gamedev2.git/commitdiff
text on top of dialog box
authorClyne Sullivan <clyne@bitgloo.com>
Wed, 16 Nov 2022 01:58:24 +0000 (20:58 -0500)
committerClyne Sullivan <clyne@bitgloo.com>
Wed, 16 Nov 2022 01:58:24 +0000 (20:58 -0500)
Scripts/init.lua
src/ui.cpp

index 441cc2a7c01838bf2b818c223fd5f218dea0df2e..7ac91607f3ef89a5038be42b0caa64396a989c75 100644 (file)
@@ -4,33 +4,32 @@ player = {
     Player = 0,
     EventListeners = {
         MoveLeftPressed = function(self)
-            --self.Velocity.x = self.Velocity.x - 3.0
-            self.Velocity.y = self.Velocity.y - 1.0
+            self.Velocity.x = self.Velocity.x - 3.0
+            --self.Velocity.y = self.Velocity.y - 1.0
             self.Render.flipx = true;
         end,
         MoveLeftReleased = function(self)
-            -- TODO can't put text at world coordinates right now
-            --game.puts("default", self.Position.x, self.Position.y+100, "Hey. Hag?")
-            --self.Velocity.x = self.Velocity.x + 3.0
-            self.Velocity.y = self.Velocity.y + 1.0
+            self.Velocity.x = self.Velocity.x + 3.0
+            --self.Velocity.y = self.Velocity.y + 1.0
         end,
         MoveRightPressed = function(self)
-            --self.Velocity.x = self.Velocity.x + 3.0
-            self.Velocity.y = self.Velocity.y + 1.0
+            self.Velocity.x = self.Velocity.x + 3.0
+            --self.Velocity.y = self.Velocity.y + 1.0
             self.Render.flipx = false;
         end,
         MoveRightReleased = function(self)
-            --self.Velocity.x = self.Velocity.x - 3.0
-            self.Velocity.y = self.Velocity.y - 1.0
+            self.Velocity.x = self.Velocity.x - 3.0
+            --self.Velocity.y = self.Velocity.y - 1.0
         end,
         JumpKeyPressed = function(self)
             if self.Physics.standing == true then
                 game.play(self.Position, self.Audio)
-                self.Velocity.y = self.Velocity.y + 9
+                --self.Velocity.y = self.Velocity.y + 9
             end
         end,
         JumpKeyReleased = function(self)
-            game.dialog(30, -150, 400, 100)
+            game.dialog(30, 150, 400, 100)
+            game.puts("default", 36, 52, "Hey. Hag?")
         end
     },
     Position = {
index 5d8b0cc2ad461eeb208f059967a4a9ab585bbcc8..17546869c6b8100fb2d60653dd0ba2187fbf2ed2 100644 (file)
@@ -15,7 +15,7 @@ void UISystem::configure(entityx::EntityManager&, entityx::EventManager&)
 void UISystem::createDialogBox(float x, float y, float w, float h)
 {
     // Queue for generation in the main thread.
-    m_boxes.emplace_back(0, x, y, w, h);
+    m_boxes.emplace_back(0, x, -y, w, h);
 }
 
 void UISystem::update(entityx::EntityManager&,