setscreen ("graphics:340;380,nobuttonbar,offscreenonly")
colorback (black)
color (white)
var element : array 1 .. 9, 1 .. 18 of string %Put elements here
var mx, my, mz : int
proc refresh
cls
for i : 1 .. 9 % y-values
for q : 1 .. 18 % x-values
drawbox ((q - 1) * 20, (i - 1) * 40, (1) * 20, (i) * 40, white)
end for
end for
put "Element # ", ceil (mx / 20), ",", ceil (my / 40) %rounding up
% You can now do something like
% if mz = 1 then
% selectedElement := element (ceil (mx / 20), ceil (my / 40))
% end if
View.Update
end refresh
loop
mousewhere (mx, my, mz)
refresh
exit when hasch
end loop
|