CopyImage

Family: Image · 2 forms

What it does

CopyImage brings an Image object into being: it is how the rest of the program comes to have one. It takes fromImage (an integer), x (an integer), y (an integer), width (an integer) and height (an integer), and answers an integer. That is the first of 2 forms.

Syntax

1
CopyImage(fromImage integer, x integer, y integer, width integer, height integer) → integer
2
CopyImage(newImage integer, fromImage integer, x integer, y integer, width integer, height integer)

Parameters

NameTypeIn forms
fromImageintegerall
xintegerall
yintegerall
widthintegerall
heightintegerall
newImageinteger2

What each form returns

1image = CopyImage(1, 100, 120, 64, 64)integer
2CopyImage(1, 1, 100, 120, 64, 64)nothing

Example · generated

Form 1, the command hands back the id

image = CopyImage(1, 100, 120, 64, 64)DO  Sync()LOOP

Form 2, you choose the id yourself

CopyImage(1, 1, 100, 120, 64, 64)DO  Sync()LOOP

CopyImage is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

35 commands in Image