Skip to content

Instantly share code, notes, and snippets.

@Achie72
Created September 20, 2023 19:03
Show Gist options
  • Save Achie72/098e458d49495011fa7631fd672e022b to your computer and use it in GitHub Desktop.
Save Achie72/098e458d49495011fa7631fd672e022b to your computer and use it in GitHub Desktop.
TextBoxes for Crea8
function draw_box(x, y, w, h, style)
-- chip
if style == 0 then
-- the top-corner decal sprite
spr(240, x-1, y)
-- top
line(x, y, x+w-4, y, 7)
--left
line(x, y, x, y+h, 7)
-- bot
line(x, y+h, x+w, y+h, 7)
-- the bottom decal in chips
spr(241, x+w-8, y+h)
--right
line(x+w-4, y, x+w, y+4, 7)
-- the diagonal cut
line(x+w, y+4, x+w, y+h, 7)
elseif style==1 then
-- textbox
rect(x, y, x+w, y+h, 7)
-- the 3 corner pieces
spr(242, x+w-4, y-3)
spr(243, x+w-4, y+h-4)
spr(244, x-3, y+h-4)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment