Table of Contents

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: * tsb_block_rec_01.bas''

ABBREVIATION

 Blk

AVAILABLE ON

ANY PROBLEM?

If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!

POWERED BY