What it does
ImageFromScreen takes x (a float), y (a float), width (a float) and height (a float), and answers an integer. That is the first of 2 forms.
Syntax
1
ImageFromScreen(x float, y float, width float, height float) → integer2
ImageFromScreen(imageID integer, x float, y float, width float, height float)Parameters
| Name | Type | In forms |
|---|---|---|
| x | float | all |
| y | float | all |
| width | float | all |
| height | float | all |
| imageID | integer | 2 |
What each form returns
| 1 | ImageFromScreen(100.0, 120.0, 64.0, 64.0) | integer |
| 2 | ImageFromScreen(image, 100.0, 120.0, 64.0, 64.0) | nothing |
Example · generated
Form 1, the command hands back the id
DO Print(ImageFromScreen(100.0, 120.0, 64.0, 64.0)) Sync()LOOPForm 2, you choose the id yourself
image = LoadImage("assets/sprite.png", 1)ImageFromScreen(image, 100.0, 120.0, 64.0, 64.0)DO Sync()LOOPImageFromScreen 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.