Skip to content

BASIC GET TILEMAP Statement

Mike Hogsett edited this page Aug 5, 2024 · 3 revisions

GET TILEMAP

TYPE: plusBASIC graphics statement


FORMAT: GET TILEMAP ( startcol , startrow ) - ( endcol , endrow ) , *arrayname

Action: Copies a rectangle section of cells from the tilemap to a numeric array.

  • startcol and startrow specifies the upper-left corner of the rectangle.
  • endcol and endrow specifies the lower-right corner of the rectangle.
  • arrayname is the name of the array to copy the tilemap data into.
    • The array must already be DIMensioned to a size large enough to hold the data.
    • To calculate the size of an array needed to store the elements in a rectangle:
      • Multiply the width of the rectangle in columns by the height in lines.
      • Round up to an even number
      • Divide by two
  • Illegal Quantity results from any of the following conditions:
    • startcol or endcol are not in the range 0 through 63.
    • startrow or endrow are not in the range 0 through 31.
    • endcol is less than startcol or endrow is less than startrow.

Examples:

10 DIM A(13)
20 GET TILEMAP (2,3)-(7,8),*A

Copies tilemap contents from column 2, line 3 to column 7, line 8 into array A().


FORMAT: GET TILEMAP ( startcol , startrow ) - ( endcol , endrow ) , ^stringvar

Action: As above but copies the tilemap cells to string variable.

  • stringvar is the name of the array to copy the tilemap data into.
    • The total number of cells in the rectangle must be less than 127.
  • String too long error results if the rectangle contains more than 126 cells.

Examples:

10 DIM A(13)
20 GET TILEMAP (2,3)-(7,8),^A$(1)

Copies text tilemap contents from column 2, line 3 to column 7, line 8 into string variable A$(1).

Clone this wiki locally