Topic : The GFA-Basic Compendium Author : GFA Systemtechnik GmbH Version : GFABasic.HYP v2.98 (12/31/2023) Subject : Documentation/Programming Nodes : 899 Index Size : 28056 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : @default : Document not found @help : Help @options : +g -i -s +z @width : 75 @hostname : STRNGSRV @hostname : CAB @hostname : HIGHWIRE @hostname : THING View Ref-FileDEFFILL [color],[interior],[style] DEFFILL [color],bitpattern$ color, interior, style: iexp bitpattern$: sexp This command determines the fill used for the commands PBOX, PCIRCLE, PELLIPSE, POLYFILL, and FILL. It sets the color, interior, and style of the filling and enables one to define one's own patterns. The fill color can be assigned values from 0 to 255, depending on the current screen resolution (see the beginning of this chapter). The following results are obtained from assignment of values to 'interior': interior Description Comment 0 Hollow always color index 0 1 Solid as set by vsf_color() 2 Pattern style set by vsf_style() 3 Hatch style set by vsf_style() 4 User defined as set by vsf_udpat() (default ␎␏ symbol) Style can be selected from 24 pattern fills or 12 hatch fills by means of the 'style' parameter (see Appendix: Fill Pattern Table). Parameters can be omitted from this definition, as long as the parameter-separating commas are included. Thus, DEFFILL ,2,4 selects the fill-pattern 2,4 and leaves the fill color as previously defined. In the second variation of the command DEFFILL, using the 32 byte parameter 'bitpattern$', a 16 x 16 pixel pattern can be defined. This information must be presented in word format and can be assembled by means of the MKI$() command. The medium resolution fill pattern is represented by two bit-planes which are combined to define the actual colors produced. The 16 words for the second bit-plane optionally follow the 16 words of the first. The first bits from each of these bit-planes are combined, this two bit number (in the range 0 to 3) represents the color of the pixel at the top left corner of the block. The second pair of bits represents the color of the second pixel, to the right of the first, and so on. For low resolution, four bit-planes are needed to represent a color fill pattern (one plane could be used but this would give a single color pattern), therefore the bit pattern must be 64 words (128 bytes) in length. The first bit-plane represents the least significant bit of the color. If however the second of these planes is left off, this will result in a single color fill pattern, the color being that chosen in the parameter 'color'. Example: DEFFILL 1,2,4 PBOX 10,10,40,40 BOX 50,50,100,100 FILL 70,70 FOR i=1 TO 16 f$=f$+MKI$(RAND(65535)) NEXT i BOX 100,100,150,150 DEFFILL 1,f$ FILL 120,120 --> Draws two boxes filled with a standard pattern and a third filled with a random pattern. DO FOR j%=0 TO 15 f$="" s%=BCHG(s%,j%) FOR i%=1 TO 16 f$=f$+MKI$(s%) NEXT i% DEFFILL 1,f$ PBOX 0,0,639,399 NEXT j% LOOP --> Parallel vertical bars are displayed and increase in size until they fill the screen. This is done by defining and altering a fill pattern and displaying a rectangle filled with this pattern. FOR i%=1 TO 64 !64 for low, 32 for medium, and 16 for high resolution READ a% a$=a$+MKI$(a%) NEXT i% DEFFILL ,a$ PBOX 20,20,300,200 ' First Bit-plane: DATA -1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0 ' Second Bit-plane: DATA -1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1,0,0,0,0 ' Third Bit-plane: DATA -1,-1,0,0,-1,-1,0,0,-1,-1,0,0,-1,-1,0,0 ' Fourth Bit-plane: DATA -1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0 --> This routine creates a filled pattern which, on a mono monitor, has two broad black and white strips. In medium resolution, four strips of half the width are produced in the four possible colors. In the case of the low resolution mode, 16 strips of one line height result, in all 16 colors. This pattern is then used to fill a box by PBOX. VDI calls: DEFFILL vsf_color(),vsf_interior(),vsf_style() DEFFILL vsf_color(),vsf_udpat() Memo: No error handling on the string length at all. Planes LEN() in bytes Words ------- ----------------- ----- 1 32 (16*16*1)/8 16 (works in any mode) 2 64 (16*16*2)/8 32 4 128 (16*16*4)/8 64 8 256 (16*16*8)/8 128 15 1024 16*16*4 512 (exceeds INTIN() array limits) 16 1024 .. .. 24 1024 .. .. 32 1024 .. .. If the mode is High or True color, pass a pattern with 32-bit pixels. The format is always 'xrgb', one long per pixel. Editor accepts DEFFILL with no parameters. Has no effect. Generates no code compiled. vsf_color()+, vsf_interior()+, vsf_style()+, vsf_udpat()+