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)