49 lines
1.3 KiB
Lua
49 lines
1.3 KiB
Lua
balloon={
|
|
text=nil,
|
|
height=0,
|
|
tail={pos=0,under=true},
|
|
pos=0,
|
|
cursor={x=0,y=0},
|
|
old_update=nil,
|
|
|
|
show=function(txt,height,tail)
|
|
balloon.text=txt
|
|
balloon.height=height
|
|
balloon.tail=tail
|
|
balloon.pos=0
|
|
balloon.cursor={x=0,y=0}
|
|
balloon.old_update=update
|
|
update=balloon.update
|
|
|
|
if balloon.tail.under then
|
|
rectfill(9,height-50,153,height-15,5)
|
|
rectfill(8,height-51,152,height-16,8)
|
|
rect(8,height-51,152,height-16,6)
|
|
|
|
local pos=balloon.tail.pos
|
|
if pos<80 then
|
|
for i=0,4 do rect(pos,height-16+(4-i),pos+i,height-16+(4-i),8) end
|
|
line(pos-1,height-15,pos-1,height-10,6)
|
|
line(pos+4,height-15,pos-1,height-10,6)
|
|
else
|
|
for i=0,4 do rect(pos+i,height-16+i,pos+4,height-16+i,8) end
|
|
line(pos+5,height-15,pos+5,height-10,6)
|
|
line(pos,height-15,pos+5,height-10,6)
|
|
end
|
|
end
|
|
|
|
text("12345678901234567890123456789012\n3",16,height-44, 2)
|
|
text("UNO DOS TRES",16,height-35, 2)
|
|
text("UNO DOS TRES",16,height-26, 2)
|
|
end,
|
|
|
|
draw=function()
|
|
if ballon.text then
|
|
|
|
end
|
|
end,
|
|
|
|
update=function()
|
|
end
|
|
}
|