From 8008588db42d5d91867bb0e8f8a9576bcf9ab380 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 13 Feb 2024 14:32:47 +0100 Subject: [PATCH] - [FIX][EDITOR] De vegades el nom de l'actor es veia mal --- data/actors.lua | 4 ++-- data/game.lua | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/data/actors.lua b/data/actors.lua index ea09efd..f4fe5dd 100644 --- a/data/actors.lua +++ b/data/actors.lua @@ -53,8 +53,8 @@ actors={ if v.ox then x = x + v.ox end if v.oy then y = y + v.oy end - local mx = math.floor((mousex()-game.cam.x)/8) - local my = math.floor((mousey()-game.cam.y)/8) + local mx = math.floor((mousex()+game.cam.x)/8) + local my = math.floor((mousey()+game.cam.y)/8) if (mx==x or mx==x+1) and (my==y or my==y-1) then actors.under_cursor=v.name subpal(1,16,8) diff --git a/data/game.lua b/data/game.lua index 541e67d..b60c4c0 100644 --- a/data/game.lua +++ b/data/game.lua @@ -126,7 +126,12 @@ game={ actors.draw() subpal() if actors.under_cursor~="" then - text(actors.under_cursor,mousex()+8,mousey()+8,9) + if (mousex()<=80) then + text(actors.under_cursor,mousex()+game.cam.x+4,mousey()+game.cam.y+4,9) + else + local size = #actors.under_cursor + text(actors.under_cursor,mousex()+game.cam.x-size*4,mousey()+game.cam.y+4,9) + end end if mapa.front_layer then setsource(tiles) @@ -152,8 +157,8 @@ game={ game.draw() - local mx = math.floor((mousex()-game.cam.x)/8) - local my = math.floor((mousey()-game.cam.y)/8) + local mx = math.floor((mousex()+game.cam.x)/8) + local my = math.floor((mousey()+game.cam.y)/8) text(mx..","..my,1,19,8) text(game.cam.x..","..game.cam.y,1,1,8)