SecondBASIC Documentation v3

Home / Command Reference / DrawTiles

DrawTiles

Description: Draws one or more tiles on the screen at location <X>, <Y> that is <Width>, <Height> in size. One unit of <X>, <Y> and <Width>, <Height> is equal to one 8x8 tile.

Syntax:

DrawTiles <Label>, <Address>, <X>, <Y>, <Width>, <Height> [, <LabelOffset>]

Part Description
<Label> Required. The label where the tile map is located. The map must be in byte format using the Data command.
<Address> Required. This is the location in VRAM where the tile resides. Typical VRAM values are 0-1344. You can use other addresses, but it's not recommended as those locations may get overwritten by other data such as the sprite table or plane data.
<X> Required. The x-coordinate to draw the tile.
<Y> Required. The y-coordinate to draw the tile.
<Width> Required. The width of the pattern to be drawn.
<Height> Required. The height of the pattern to be drawn.
<LabelOffset> Optional. The number of bytes you want to offset from the <Label>.

Example:

    DrawTiles MyMap, 0, 0, 0, 2, 2
 
MyMap:
    Data 65,66,67,68