prototype for REARM screen UI

This commit is contained in:
Kistaro Windrider 2024-12-24 19:04:07 -08:00
parent 98f56328a6
commit f761d1a172
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -6,6 +6,13 @@ __lua__
function _draw() function _draw()
cls() cls()
-- draw_placeholder()
draw_weap_opt(0,0,frame_col(false),1,"hull","\n +1\n max\nhealth")
draw_weap_opt(56,0,frame_col(true),2,"vulc"," rate\n\n faster\n firing\n rate")
draw_rearm(frame_col(false))
end
function draw_placeholder()
-- hud placeholder -- hud placeholder
rectfill(112, 0, 127, 127,0x56) rectfill(112, 0, 127, 127,0x56)
@ -13,26 +20,66 @@ function _draw()
line(127,1,127,127,5) line(127,1,127,127,5)
line(113,127) line(113,127)
glow_box(0, 0, 55, 100, 4, 10, 1) glow_box(0, 0, 55, 100, {4, 10}, 1)
glow_box (0, 101, 111, 127, 4, 10, 1) glow_box (0, 101, 111, 127, {4, 10}, 1)
if t()%1>0.5 then if t()%1>0.5 then
glow_box(56, 0, 111, 100, 14, 7, 1) glow_box(56, 0, 111, 100, {14, 7}, 1)
else else
glow_box(56, 0, 111, 100, 2, 8, 1) glow_box(56, 0, 111, 100, {2, 8}, 1)
end end
print("■ full ammo\n■ full shield\n■ +50% health", 5, 106, 6)
-- rect(4, 4, 123, 123, 4) -- rect(4, 4, 123, 123, 4)
-- rect(5, 5, 122, 122, 10) -- rect(5, 5, 122, 122, 10)
-- rect(6, 6, 121, 121, 4) -- rect(6, 6, 121, 121, 4)
end end
function glow_box(x0, y0, x1, y1, c0, c1, cf) function glow_box(x0, y0, x1, y1, c, cf)
rect(x0, y0, x1, y1, c0) rect(x0, y0, x1, y1, c[1])
rect(x0+1, y0+1, x1-1, y1-1, c1) rect(x0+1, y0+1, x1-1, y1-1, c[2])
rect(x0+2, y0+2, x1-2, y1-2, c0) rect(x0+2, y0+2, x1-2, y1-2, c[1])
if cf then if cf then
-- todo: animate "dot crawl" background
fillp(…) fillp(…)
rectfill(x0+3, y0+3, x1-3, y1-3, cf) rectfill(x0+3, y0+3, x1-3, y1-3, cf)
fillp() fillp()
end end
end end
function frame_col(hot)
if (not hot) return {4,10}
if (t()%1>0.5) return {14,7}
return {2,8}
end
function draw_weap_opt(x, y, c, s, hdr, body)
camera(-x,-y)
glow_box(0,0,55,100,c,1)
spr(s,5, 5)
print(hdr, 13, 8, 7)
print(body, 5, 15, 6)
camera()
end
function draw_rearm(c)
glow_box(0,101,111,127,c,1)
spr(5,4,105,4,2)
print("■ full ammo\n■ full shield\n■ +50% health",40, 106, 6)
end
__gfx__
000000000b00000000000a0007700770000aa0000444440004444444000000000000000000000000000000000000000000000000000000000000000000000000
00000000bba80880000008000aa00aa00a0880a0447777700477777a000000000000000000000000000000000000000000000000000000000000000000000000
007007000aaa28780a0000000990099008000080477aaa7a0477aaaa000000000000000000000000000000000000000000000000000000000000000000000000
0007000008a8887808000000099009900080080047a0047a047a0000000000000000000000000000000000000000000000000000000000000000000000000000
00007000088888820000a000088008800000000047a0447a047a0000000000000000000000000000000000000000000000000000000000000000000000000000
00700700008888200000800008800880a000000a47a4477a047a4440000000000000000000000000000000000000000000000000000000000000000000000000
000000000008820000a0000008800880080aa080477777a00477777a000000000000000000000000000000000000000000000000000000000000000000000000
0000000000002000008000000880088000088000477770000422aaaa222200020000020000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000047a77700022ee0002eeee002e00022e000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000047a4777002ea2e002e002e02ee022ee000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000047a0477a22ea2e002e002e02e2e2e2e000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000047a0047a2e2222e02e222e02e02e02e000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000047a0047a2eeeeeea2eeee002e02e02e000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000aa000aa2e7aa2ea2e00e002e02e02e000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000002e0002e02e002e02e02e02e000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000e0000e00e000e00e00e00e000000000000000000000000000000000000000000000000000000000