Code: Select all
'' Animation by switching 2 colors
type Font
w as long
h as long
d as any ptr
end type
enum
FB_FONT_8 = 0,
FB_FONT_14
FB_FONT_16
end enum
extern Fonts(2) alias "__fb_font" as Font
sub EditChar cdecl (byref f as Font, c as ubyte, ...)
Dim As cva_list args
cva_start(args,c)
dim as long y,yend,code
dim row as ubyte ptr
yend=f.h
code=c:code*=f.h:row=f.d+code
for y = 1 to yend
*row=cva_arg(args, ubyte)
row+=1
next
end sub
screen 12,8,1,1
color 15,0
Cls
editchar (Fonts(FB_FONT_16),asc("@"), 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255)
'' a block character
Dim as UByte i,x,y,n,ct,xt,c1,c2
c1 = 0:c2 = 15:xt = 0:ct = 0
DO
x = 8:y = 4
for n = 1 to 24
for i = 1 to 32
screenlock
color c1:locate y,x:print "@":color c2:Locate y,x + 1:print "@"
screenunlock
x += 2
next
y += 1
xt += 1
if xt = 1 Then x = 9
if xt = 2 Then x = 8:xt = 0
next
ct += 1
if ct = 1 Then c1 = 15:c2 = 0
if ct = 2 Then c1 = 0:c2 = 15:ct = 0
sleep 100,1
Loop until InKey = Chr(27)