- FIX: Els accents no se veïen
- Proves amb tamanys i posició del bocadills de chamó i text
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
balloon={
|
balloon={
|
||||||
text=nil,
|
text=nil,
|
||||||
pos=1,
|
pos=1,
|
||||||
|
ini=1,
|
||||||
cursor={x=0,y=0},
|
cursor={x=0,y=0},
|
||||||
old_update=nil,
|
old_update=nil,
|
||||||
rect=nil,
|
rect=nil,
|
||||||
@@ -12,12 +13,16 @@ balloon={
|
|||||||
if rectangle==nil then
|
if rectangle==nil then
|
||||||
balloon.rect={x=8,y=actor.y*8-4,w=144,h=35}
|
balloon.rect={x=8,y=actor.y*8-4,w=144,h=35}
|
||||||
else
|
else
|
||||||
balloon.rect=rectangle
|
balloon.rect={}
|
||||||
|
balloon.rect.x=rectangle.x*8
|
||||||
balloon.rect.y=actor.y*8-4
|
balloon.rect.y=actor.y*8-4
|
||||||
|
balloon.rect.w=rectangle.w*8
|
||||||
|
balloon.rect.h=rectangle.h*9+8
|
||||||
end
|
end
|
||||||
|
|
||||||
balloon.text=txt
|
balloon.text=txt
|
||||||
balloon.pos=1
|
balloon.pos=1
|
||||||
|
balloon.ini=1
|
||||||
|
|
||||||
balloon.old_update=update
|
balloon.old_update=update
|
||||||
update=balloon.update
|
update=balloon.update
|
||||||
@@ -25,11 +30,11 @@ balloon={
|
|||||||
local pos,height=actor.x*8+4,actor.y*8-4
|
local pos,height=actor.x*8+4,actor.y*8-4
|
||||||
|
|
||||||
if below==nil or below==false then
|
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
|
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+1,y+1,x+w+1,y+h+1,5)
|
||||||
rectfill(x,y,x+w,y+h,8)
|
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
|
if pos<80 then
|
||||||
for i=0,4 do rect(pos,y+h+(4-i),pos+i,y+h+(4-i),8) end
|
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
|
update=balloon.old_update
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
local txt=string.sub(balloon.text,balloon.ini,balloon.pos)
|
||||||
local char=string.sub(balloon.text,balloon.pos,balloon.pos)
|
local char=string.sub(balloon.text,balloon.pos,balloon.pos)
|
||||||
if char=='' then
|
if char=='' then
|
||||||
-- final
|
-- final
|
||||||
@@ -95,12 +101,13 @@ balloon={
|
|||||||
elseif char=='\n' then
|
elseif char=='\n' then
|
||||||
-- salt de linea
|
-- salt de linea
|
||||||
balloon.pos=balloon.pos+1
|
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
|
balloon.cursor.y=balloon.cursor.y+9
|
||||||
else
|
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.pos=balloon.pos+1
|
||||||
balloon.cursor.x=balloon.cursor.x+4
|
--balloon.cursor.x=balloon.cursor.x+4
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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() actors.add({name="usufondo",x=16,y=8,o="d",gfx={x=0,y=0}}) scene.cont() end,
|
||||||
function() wait.start(1) end,
|
function() wait.start(1) end,
|
||||||
function() actors.search("usufondo").path={pos=0,route='dlllll'} 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() actors.search("usufondo").path={pos=0,route='rrrrru'} end,
|
||||||
function() wait.start(0.5) end,
|
function() wait.start(0.5) end,
|
||||||
function() actors.remove("usufondo") scene.cont() end,
|
function() actors.remove("usufondo") scene.cont() end,
|
||||||
function() wait.start(1) 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
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user