% Selection Box ----------------------------------------------------
proc drawSelecLineY (x, y, buttonxsize, buttonysize : int)
for i : 4 .. buttonysize - 4 by 2
drawdot (x, y + i, 1)
end for
end drawSelecLineY
proc drawSelecLineX (x, y, buttonxsize, buttonysize : int)
for i : 4 .. buttonxsize - 4 by 2
drawdot (x + i, y, 1)
end for
end drawSelecLineX
proc drawSelectionBox (x, y, buttonxsize, buttonysize : int)
drawSelecLineY (x + 4, y, buttonxsize, buttonysize)
drawSelecLineY (x - 4 + buttonxsize, y, buttonxsize, buttonysize)
drawSelecLineX (x, y + 4, buttonxsize, buttonysize)
drawSelecLineX (x, y - 4 + buttonxsize, buttonxsize, buttonysize)
end drawSelectionBox
% -------------------------------------------------------------------
% Draw Released Button ----------------------------------------------------------------
proc objReButton (x, y, buttonxsize, buttonysize, clr : int)
drawline (x, y, x + buttonxsize, y, 15)
drawline (x + buttonxsize, y, x + buttonxsize, y + buttonysize, 15)
drawline (x + 1, y + 1, x - 1 + buttonxsize, y + 1, 22)
drawline (x + buttonxsize - 1, y + 1, x - 1 + buttonxsize, y + buttonysize - 1, 22)
drawfillbox (x + 2, y + 2, x - 2 + buttonxsize, y - 2 + buttonysize, clr)
drawline (x + 1, y + buttonysize - 1, x - 2 + buttonxsize, y + buttonysize - 1, 30)
drawline (x + 1, y + buttonysize - 1, x - buttonxsize + 1 + buttonxsize, y + 2, 30)
drawline (x, y + buttonysize, x - 1 + buttonxsize, y + buttonysize, 31)
drawline (x, y + buttonysize, x - buttonxsize + buttonxsize, y + 1, 31)
end objReButton
% -------------------------------------------------------------------------------------
% Draw Pressed Button ------------------------------------------------------
proc objPrButton (x, y, buttonxsize, buttonysize, clr : int)
drawfillbox (x + 2, y + 2, x - 2 + buttonxsize, y - 2 + buttonysize, clr)
drawbox (x, y, x + buttonxsize, y + buttonysize, 7)
drawbox (x + 1, y + 1, x - 1 + buttonxsize, y - 1 + buttonysize, 22)
end objPrButton
% --------------------------------------------------------------------------
% Draw Button(x, y, width, height, colour : int, [released/pressed], [selected/deselected] : srting)
proc drawbutton (x, y, buttonxsize, buttonysize, clr : int, press, select : string)
if press = "released" and select = "selected" then
objReButton (x, y, buttonxsize, buttonysize, clr)
drawSelectionBox (x, y, buttonxsize, buttonysize)
elsif press = "released" and select = "deselected" then
objReButton (x, y, buttonxsize, buttonysize, clr)
elsif press = "pressed" and select = "selected" then
objPrButton (x, y, buttonxsize, buttonysize, clr)
drawSelectionBox (x, y, buttonxsize, buttonysize)
elsif press = "pressed" and select = "deselected" then
objPrButton (x, y, buttonxsize, buttonysize, clr)
end if
end drawbutton
% All Possibilities -------------------------------------------
drawbutton (1, 1, 50, 50, brightblue, "released", "deselected")
drawbutton (1, 51, 50, 50, brightblue, "pressed", "deselected")
drawbutton (1, 102, 50, 50, brightblue, "released", "selected")
drawbutton (1, 153, 50, 50, brightblue, "pressed", "selected")
%--------------------------------------------------------------
|