{{htmlmetatags>metatag-robots=() metatag-title=(BLOCK | ugBASIC User Manual) metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum) metatag-description=(Manual page for BLOCK) metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png) metatag-og:title=(BLOCK | ugBASIC User Manual) metatag-og:description=(Manual page for BLOCK) }} ====== ugBASIC User Manual ====== ===== BLOCK ✓ ===== ===== SYNTAX ===== DEFINE AUDIO SYNC DEFINE AUDIO ASYNC BLOCK x1, y1, x2, y2, fq ==== PURPOSE ==== This pragma allows you to indicate whether the sound should be played synchronously or asynchronously with the execution of subsequent instructions. Specifically, with ''DEFINE AUDIO SYNC'', effects and notes are played synchronously, so you do not have to wait for completion to execute the next command. On the contrary, with ''DEFINE AUDIO ASYNC'', effects and notes are played asynchronously, so you must wait for completion otherwise subsequent commands will be executed during the sound effect/note. Note that not all targets support both modes. ''BLOCK'' draws a filled rectangle. The location of the top left corner is determined by the first two parameters ''x1'' and ''y1'', the coordinates of the bottom right corner of the rectangle are determined by parameters three and four (''x2'' and ''y2'', where ''x2=x1+width'' and ''y2=y1+height'', important for ''REC''). The color of the rectangle is determined by the last parameter (''fq'', color source). Permissible values ​​are 0..''SCREEN WIDTH'' for ''x1'' and ''x2' . For ''y1'' and ''y2'', values ​​from 0 to ''SCREEN HEIGHT'' are permitted in both cases. The color also depends on the graphics mode and refers to the color specifications behind ''HIRES'' on the one hand and ''MULTI'' and ''LOW COL'' on the other. The point 0,0 is in the top left corner. Note: Unfortunately, the parameter types of ''REC'' and ''BLOCK'' do not match, which makes programming a little more complicated (see program example). ==== EXAMPLE ==== DEFINE AUDIO SYNC BLOCK x, y, x+29, y+19, 0 See also the following example files: * ''[[https://github.com/spotlessmind1975/ugbasic/tree/main/examples/tsb_block_rec_01.bas|tsb_block_rec_01.bas]]'' ==== ABBREVIATION ==== Blk ==== AVAILABLE ON ==== * Atari (400/800) * Atari XL/XE * Commodore 128 (MOS 8502) * Commodore 128 (Zilog Z80) * Commodore 64 * Commodore 64+REU * TRS-80 Color Computer * TRS-80 Color Computer 3 * ColecoVision * Amstrad CPC 664 * Dragon 32 * Dragon 64 * Thomson MO5 * Thomson MO5 * Olivetti Prodest PC128 * Commodore PLUS/4 * SEGA SC-3000 * SEGA SG-1000 * VG-5000 * Commodore VIC-20 * ZX Spectrum 48 ==== ANY PROBLEM? ==== If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON BLOCK|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY ===== [[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]