1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
# test_slice.kbs
# 2010-05-08 j.m.reneau
# test functionality of getslice and putslice
color black
rect 0,0,300,300
for x = 10 to 300 step 10
for y = 0 to 300 step 10
color rgb(rand*256, rand*256, rand*256)
rect x,y,10,10
next y
next x
k$ = getslice(0,0,25,25)
print length(k$)
print k$
l$ = getslice(50,50,100,75)
print length(l$)
w$ = getslice(0, 0, graphwidth, graphheight)
print length(w$)
print "test with no transparent color"
input "press return", a$
color green
rect 0,0,300,300
putslice 50,50,l$
for t = 1 to 100
putslice rand*280, rand*280,k$
next t
pause .5
rect 0,0,100,100
print "now test with a black transparent color"
input "press return", a$
color red
rect 0,0,300,300
putslice 50,50,l$, black
for t = 1 to 100
putslice rand*280, rand*280,k$,black
next t
pause .5
rect 0,0,100,100
print "now restore screen"
input "press return", a$
rect 0,0,300,300
putslice 0, 0, w$
print "end"
|