'set it!
B(generate).X = 100 + space
B(generate).Y = 100
B
(generate
).Label
= "Button nr. " + STR$(generate
) space = space + 60
'draw it
BWidth = 50
BHeight = 20
LINE (B
(d
).X
, B
(d
).Y
)-(B
(d
).X
+ BWidth
, B
(d
).Y
+ BHeight
), , B
' 21: button width / 2 - fontwidth / 2 (default font width is 8, so 50 / 2 - 8 / 2 = 25 - 4 = 21 -> center to middle
'save screen image
'and now use it...
t = 0
IF MX
>= B
(t
).X
AND MX
<= B
(t
).X
+ BWidth
THEN IF MY
>= B
(t
).Y
AND MY
<= B
(t
).Y
+ BHeight
THEN ' 16: Default font height is 16, so label is displayed 1 row lower
t = t + 1
'restore screen image