From 6a1aafe4d460f58414cba5b77558e84ada154d86 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 31 Jan 2023 18:02:49 +0100 Subject: [PATCH] =?UTF-8?q?-=20FIX:=20Els=20accents=20no=20se=20ve=C3=AFen?= =?UTF-8?q?=20-=20Proves=20amb=20tamanys=20i=20posici=C3=B3=20del=20bocadi?= =?UTF-8?q?lls=20de=20cham=C3=B3=20i=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/balloon.lua | 19 +++++++++++++------ data/game.lua | 4 ++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/data/balloon.lua b/data/balloon.lua index 7dd3507..46e54cb 100644 --- a/data/balloon.lua +++ b/data/balloon.lua @@ -1,6 +1,7 @@ balloon={ text=nil, pos=1, + ini=1, cursor={x=0,y=0}, old_update=nil, rect=nil, @@ -12,12 +13,16 @@ balloon={ if rectangle==nil then balloon.rect={x=8,y=actor.y*8-4,w=144,h=35} else - balloon.rect=rectangle + balloon.rect={} + balloon.rect.x=rectangle.x*8 balloon.rect.y=actor.y*8-4 + balloon.rect.w=rectangle.w*8 + balloon.rect.h=rectangle.h*9+8 end balloon.text=txt balloon.pos=1 + balloon.ini=1 balloon.old_update=update update=balloon.update @@ -25,11 +30,11 @@ balloon={ local pos,height=actor.x*8+4,actor.y*8-4 if below==nil or below==false then - balloon.rect.y=balloon.rect.y-51 + balloon.rect.y=balloon.rect.y-balloon.rect.h-16 local x,y,w,h=balloon.rect.x,balloon.rect.y,balloon.rect.w,balloon.rect.h rectfill(x+1,y+1,x+w+1,y+h+1,5) rectfill(x,y,x+w,y+h,8) - rect(x,y,x+y,y+h,6) + rect(x,y,x+w,y+h,6) if pos<80 then for i=0,4 do rect(pos,y+h+(4-i),pos+i,y+h+(4-i),8) end @@ -87,6 +92,7 @@ balloon={ update=balloon.old_update end else + local txt=string.sub(balloon.text,balloon.ini,balloon.pos) local char=string.sub(balloon.text,balloon.pos,balloon.pos) if char=='' then -- final @@ -95,12 +101,13 @@ balloon={ elseif char=='\n' then -- salt de linea balloon.pos=balloon.pos+1 - balloon.cursor.x=balloon.rect.x+8 + balloon.ini=balloon.pos + --balloon.cursor.x=balloon.rect.x+8 balloon.cursor.y=balloon.cursor.y+9 else - text(char,balloon.cursor.x,balloon.cursor.y,2) + text(txt,balloon.cursor.x,balloon.cursor.y,2) balloon.pos=balloon.pos+1 - balloon.cursor.x=balloon.cursor.x+4 + --balloon.cursor.x=balloon.cursor.x+4 end end end diff --git a/data/game.lua b/data/game.lua index 65b0a3e..23d6492 100644 --- a/data/game.lua +++ b/data/game.lua @@ -18,12 +18,12 @@ game={ function() actors.add({name="usufondo",x=16,y=8,o="d",gfx={x=0,y=0}}) scene.cont() end, function() wait.start(1) end, function() actors.search("usufondo").path={pos=0,route='dlllll'} end, - function() balloon.show("HOY NO HAY JAIL!\n800 MEGAS!!","usufondo",true) end, + function() balloon.show("HOY NO HAY JAIL!\nTU MISMO!!","usufondo",false,{x=7,w=10,h=2}) end, function() actors.search("usufondo").path={pos=0,route='rrrrru'} end, function() wait.start(0.5) end, function() actors.remove("usufondo") scene.cont() end, function() wait.start(1) end, - function() balloon.show("PAYASO...","jailer",true) end + function() balloon.show("IMBÈSIL...","jailer",true,{x=5,w=7,h=1}) end }) end end