LoadSubImage

Family: Image · 2 forms

What it does

LoadSubImage writes to an Image object: it loads rather than reads. It takes iImageIndex (an integer), iParentIndex (an integer) and sImageFilename (a string), and returns nothing. That is the first of 2 forms. iImageIndex is the id you are giving an Image object: every later call names it by that number.

Syntax

1
LoadSubImage(iImageIndex integer, iParentIndex integer, sImageFilename string)
2
LoadSubImage(iParentIndex integer, sImageFilename string) → integer

Parameters

NameTypeIn forms
iImageIndexinteger1
iParentIndexintegerall
sImageFilenamestringall

What each form returns

1LoadSubImage(1, 1, "assets/sprite.png")nothing
2subImage = LoadSubImage(1, "assets/sprite.png")integer

Example · generated

Form 1, you choose the id yourself

LoadSubImage(1, 1, "assets/sprite.png")DO  Sync()LOOP

Form 2, the command hands back the id

subImage = LoadSubImage(1, "assets/sprite.png")DO  Sync()LOOP

LoadSubImage 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.

35 commands in Image