Ce que fait la commande
ImageFromScreen prend x (un flottant), y (un flottant), width (un flottant) et height (un flottant), et rend un entier. C'est la première de 2 formes.
Syntaxe
1
ImageFromScreen(x float, y float, width float, height float) → integer2
ImageFromScreen(imageID integer, x float, y float, width float, height float)Paramètres
| Nom | Type | Dans les formes |
|---|---|---|
| x | float | toutes |
| y | float | toutes |
| width | float | toutes |
| height | float | toutes |
| imageID | integer | 2 |
Ce que rend chaque forme
| 1 | ImageFromScreen(100.0, 120.0, 64.0, 64.0) | integer |
| 2 | ImageFromScreen(image, 100.0, 120.0, 64.0, 64.0) | rien |
Exemple · engendré
Forme 1 : la commande rend l'identifiant
DO Print(ImageFromScreen(100.0, 120.0, 64.0, 64.0)) Sync()LOOPForme 2 : vous choisissez l'identifiant
image = LoadImage("assets/sprite.png", 1)ImageFromScreen(image, 100.0, 120.0, 64.0, 64.0)DO Sync()LOOPImageFromScreen est appelé et sa réponse est affichée à chaque image. La boucle DO … LOOP n'est pas décorative : un programme BASIC classique s'arrête dès qu'il n'a plus de lignes, et c'est Sync() qui dessine l'image.