start of something big

maybe.
This commit is contained in:
visionmercer 2026-05-11 12:41:20 +02:00
commit c302cb6139
2 changed files with 18 additions and 1 deletions

View file

@ -103,6 +103,13 @@ function min(a,b)
if a<=b then min=a else min=b if a<=b then min=a else min=b
end function end function
function clickregion(x as integer, y as integer, w as integer, h as integer)
if _mousex>x and _mousey>y and _mousex<x+w and _mousey<y+h then
if mouseclicked then clickregion=-1
if rmouseclicked then clickregion=-2
end if
end function
function button (x as integer,y as integer,w as integer,h as integer,caption as string) function button (x as integer,y as integer,w as integer,h as integer,caption as string)
if _mousex>x and _mousey>y and _mousex<x+w and _mousey<y+h then if _mousex>x and _mousey>y and _mousex<x+w and _mousey<y+h then
drawbutton x,y,w,h,caption,1 drawbutton x,y,w,h,caption,1

View file

@ -206,7 +206,17 @@ sub toolbox
line (16,y+16)-(64,y+64),highlightcolor,b line (16,y+16)-(64,y+64),highlightcolor,b
line (0,y)-(48,y+48),state.fcolor,bf line (0,y)-(48,y+48),state.fcolor,bf
line (0,y)-(48,y+48),highlightcolor,b line (0,y)-(48,y+48),highlightcolor,b
if clickregion(0, y, 48, 48) then
palettemanager state.fcolor
elseif clickregion(16, y + 16, 48, 48) then
palettemanager state.bcolor
end if
end sub
sub palettemanager(col as _unsigned long)
line (0,0)-(_width-1,_height-1),col,bf
_display
sleep
end sub end sub
sub colorpicker sub colorpicker