[WIP] Dialeg

This commit is contained in:
2026-04-20 22:08:02 +02:00
parent a4f989eb02
commit e152df913c
3 changed files with 47 additions and 5 deletions

40
data/dialeg.lua Normal file
View File

@@ -0,0 +1,40 @@
function dialog.new( _text, _actor )
return {
actor = _actor,
text = _text,
time = 60,
}
end
function dialeg:draw( )
local w = 50
local h = 20
local x = 0
local y = 0
y = actor.y-20
if actor.flip then
x = actor.x-w
else
x = actor.x+actor.w
end
x, y = viewp:screen_coords( x, y )
draw.rrectf(x, y, w, h, 5, 2)
if actor.flip then
draw.line(x+w, y+h-1+5, x+w-20, y+h-1, 2)
draw.line(x+w, y+h-1+5, x+w-18, y+h-1, 2)
draw.line(x+w, y+h-1+5, x+w-14, y+h-1, 2)
draw.line(x+w, y+h-1+5, x+w-12, y+h-1, 2)
else
draw.line(x, y+h-1+5, x+20, y+h-1, 2)
draw.line(x, y+h-1+5, x+18, y+h-1, 2)
draw.line(x, y+h-1+5, x+14, y+h-1, 2)
draw.line(x, y+h-1+5, x+12, y+h-1, 2)
end
local font_curr = font.current()
font.current(font_default)
draw.text(text, x+5,y+7, 16)
font.current(font_curr)
end