better icons, not good icons, but better.

This commit is contained in:
visionmercer 2026-05-20 09:27:54 +02:00
commit f5add49708

View file

@ -735,34 +735,89 @@ function icon (index as long)
static icons() as long static icons() as long
if not init then if not init then
redim icons(19) as long ' Room for 20 icons redim icons(19) as long ' Room for 20 icons
dim c as _unsigned long: c = _rgb32(255, 255, 255) ' Main icon color
' Define your specific tool icons here ' --- 1. Pencil Tool ---
icons(0) = _newimage(32,32,32): _dest icons(0): line (5, 27)-(27, 5): _dest 0 icons(0) = _newimage(32, 32, 32): _dest icons(0)
icons(1) = _newimage(32,32,32): _dest icons(1): circle (15, 15), 13: _dest 0 line (6, 26)-(22, 10), c
icons(2) = _newimage(32,32,32): _dest icons(2): line (5, 5)-(27, 27), , b: _dest 0 line (22, 10)-(26, 6), c
icons(6) = _newimage(32,32,32): _dest icons(6) line (26, 6)-(26, 10), c
line (5,15)-(15,5):line -(25,15):line -(20,25): line -(10,25):line -(5,15) line (26, 10)-(10, 26), c
line (10, 26)-(6, 26), c
pset (7, 25), c ' Tip point
_dest 0 _dest 0
' --- 2. Line Tool ---
icons(1) = _newimage(32, 32, 32): _dest icons(1)
line (5, 27)-(27, 5), c
_dest 0
' --- 3. Hollow Circle ---
icons(2) = _newimage(32, 32, 32): _dest icons(2)
circle (16, 16), 11, c
_dest 0
' --- 4. Filled Circle ---
icons(3) = _newimage(32, 32, 32): _dest icons(3)
dim r as integer
for r = 0 to 11: circle (16, 16), r, c: next r
_dest 0
' --- 5. Hollow Box ---
icons(4) = _newimage(32, 32, 32): _dest icons(4)
line (6, 6)-(26, 26), c, b
_dest 0
' --- 6. Filled Box ---
icons(5) = _newimage(32, 32, 32): _dest icons(5)
line (6, 6)-(26, 26), c, bf
_dest 0
' --- 7. Hollow Polygon (Triangle Blueprint) ---
icons(6) = _newimage(32, 32, 32): _dest icons(6)
line (16, 5)-(6, 25), c
line (6, 25)-(26, 25), c
line (26, 25)-(16, 5), c
_dest 0
' --- 8. Filled Polygon ---
icons(7) = _newimage(32, 32, 32): _dest icons(7) icons(7) = _newimage(32, 32, 32): _dest icons(7)
' Draw a small filled shape for the filled polygon icon dim py as integer
for fy = 10 to 20: line (10, fy)-(22, fy): next for py = 5 to 25
dim hw as integer: hw = (py - 5) * 10 / 20
line (16 - hw, py)-(16 + hw, py), c
next py
_dest 0 _dest 0
' --- 9. Floodfill (Paint Bucket) ---
icons(8) = _newimage(32, 32, 32): _dest icons(8) icons(8) = _newimage(32, 32, 32): _dest icons(8)
' Simple "Bucket" icon line (8, 14)-(20, 26), c ' Main body tilt left
line (8, 10)-(24, 10): line -(26, 22): line -(6, 22): line -(8, 10) line (20, 26)-(26, 20), c
line (10, 8)-(22, 8) ' Handle line (26, 20)-(14, 8), c
line (14, 8)-(8, 14), c
' Fixed syntax: Using valid multiplier expressions for the arc
circle (14, 11), 6, c, _pi(1), _pi(1.5)
pset (6, 28), c ' Spilling drip point
_dest 0 _dest 0
' Fill the remaining slots with blank 32x32 images
' --- 10. Eyedropper ---
icons(9) = _newimage(32, 32, 32): _dest icons(9)
line (6, 26)-(10, 22), c ' Pipette tip
line (10, 22)-(22, 10), c ' Shaft side A
line (6, 26)-(18, 14), c ' Bottom point accent
line (14, 18)-(26, 6), c ' Shaft side B
line (22, 10)-(26, 6), c ' Squeeze bulb cap
_dest 0
' Fill remaining fallback slots (10-19) with clean blank images
dim j as integer dim j as integer
for j = 0 to 19 for j = 10 to 19
if icons(j) = 0 then icons(j) = _newimage(32, 32, 32) if icons(j) = 0 then icons(j) = _newimage(32, 32, 32)
next next
init = -1 init = -1
end if end if
' Bounds checking to prevent returning 0 or crashing
if index >= 0 and index <= 19 then if index >= 0 and index <= 19 then
icon = icons(index) icon = icons(index)
else else