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) → integer2
CopyImage(newImage integer, fromImage integer, x integer, y integer, width integer, height integer)Parameters
| Name | Type | In forms |
|---|---|---|
| fromImage | integer | all |
| x | integer | all |
| y | integer | all |
| width | integer | all |
| height | integer | all |
| newImage | integer | 2 |
What each form returns
| 1 | image = CopyImage(1, 100, 120, 64, 64) | integer |
| 2 | CopyImage(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()LOOPForm 2, you choose the id yourself
CopyImage(1, 1, 100, 120, 64, 64)DO Sync()LOOPCopyImage 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.