What it does
LoadImage writes to an Image object: it loads rather than reads. It takes iImageIndex (an integer), sImageFilename (a string) and bBlackToAlpha (an integer), and returns nothing. That is the first of 4 forms. iImageIndex is the id you are giving an Image object: every later call names it by that number.
Syntax
1
LoadImage(iImageIndex integer, sImageFilename string, bBlackToAlpha integer)2
LoadImage(ID integer, sImageFilename string)3
LoadImage(sImageFilename string, bBlackToAlpha integer) → integer4
LoadImage(sImageFilename string) → integerParameters
| Name | Type | In forms |
|---|---|---|
| iImageIndex | integer | 1 |
| sImageFilename | string | all |
| bBlackToAlpha | integer | 1, 3 |
| ID | integer | 2 |
What each form returns
| 1 | LoadImage(1, "assets/sprite.png", 1) | nothing |
| 2 | LoadImage(1, "assets/sprite.png") | nothing |
| 3 | image = LoadImage("assets/sprite.png", 1) | integer |
| 4 | image = LoadImage("assets/sprite.png") | integer |
Example · generated
Form 1, you choose the id yourself
LoadImage(1, "assets/sprite.png", 1)DO Sync()LOOPForm 3, the command hands back the id
image = LoadImage("assets/sprite.png", 1)DO Sync()LOOPLoadImage is called with values of the types its signature asks for. 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.