Code: Select all
''angros47's redefining internal font (a.k.a custom characters) in graphic mode
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
'screenres 640,480 ',32
screen 12
editchar (Fonts(FB_FONT_16),asc("@"), 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255)
'' a giant stick character
locate 6,20:color 11
Locate 4,20:print " @@@@@@"
Locate 5,20:print " @ @@@@@@"
Locate 6,20:print " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
Locate 7,20:Print " @@@@@@@@@@@@ @"
Locate 8,20:Print " @@@@@@@@@@@@"
Locate 9,20:Print " @@@@@@@@@@@@"
Locate 10,20:Print " @@@@@@@@@@@@"
Locate 11,20:Print " @@ @@"
Locate 12,20:Print " @@ @@"
Locate 13,20:Print " @@ @@"
Locate 14,20:Print " @@ @@"
Locate 15,20:Print " @@ @@"
Locate 16,20:Print " @@@@ @@@@"
sleep