ImageFromScreen

Family: Image · 2 forms

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) → integer
2
ImageFromScreen(imageID integer, x float, y float, width float, height float)

Parameters

NameTypeIn forms
xfloatall
yfloatall
widthfloatall
heightfloatall
imageIDinteger2

What each form returns

1ImageFromScreen(100.0, 120.0, 64.0, 64.0)integer
2ImageFromScreen(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()LOOP

Form 2, you choose the id yourself

image = LoadImage("assets/sprite.png", 1)ImageFromScreen(image, 100.0, 120.0, 64.0, 64.0)DO  Sync()LOOP

ImageFromScreen 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