defines a fill pattern.
DefFill pattern
DefFill p$
pattern: integer expression
p$: string
DefFill pattern defines a fill pattern for PBox, PCircle, PEllipse, Polyfill and Fill graphic commands. One the 48 available dot or line patterns can be selected using the pattern option. (see Fill pattern table).
DefFill p$ defines a custom monochrome fill pattern. The string is 8 bytes long, where each byte specifies the 8-bits pattern for a row. Together the 8 bytes define a 8 x 8 bit pattern.
// Fill pattern table
Local h%, i%, j%, w%, ye%, ys%
OpenW # 1
w% = _X / 12, h% = _Y / 4
For i% = 1 To 48
Switch i%
Case To 12
j% = i%
ys% = 0, ye% = _Y / 4
Case 13 To 24
j% = Sub(i%, 12)
ys% = _Y / 4, ye% = _Y / 2
Case 25 To 36
j% = Sub(i%, 24)
ys% = _Y / 2, ye% = _Y * 3 / 4
Case 37 To 48
j% = Sub(i%, 36)
ys% = _Y * 3 / 4, ye% = _Y
EndSwitch
DefFill i%
PBox (j% - 1) * w%, ys%, (j% - 1) * w% + w%, ye%
Next i%
draws 48 rectangles using various fill patterns.
Local x$ = Chr$(0, $FF, 0, $FF, 0, $FF, 0, $FF)
DefFill x$
PBox 8, 8, 100, 100
{Created by Sjouke Hamstra; Last updated: 28/09/2014 by James Gaite}