What it does
CreateGradientImage writes a value: it creates rather than reads. It takes gradientID (an integer), width (an integer) and height (an integer), and answers an integer. That is the first of 2 forms. gradientID is the id you are giving a Gradient object: every later call names it by that number.
Syntax
1
CreateGradientImage(gradientID integer, width integer, height integer) → integer2
CreateGradientImage(imageID integer, gradientID integer, width integer, height integer)Parameters
| Name | Type | In forms |
|---|---|---|
| gradientID | integer | all |
| width | integer | all |
| height | integer | all |
| imageID | integer | 2 |
What each form returns
| 1 | gradientImage = CreateGradientImage(1, 64, 64) | integer |
| 2 | CreateGradientImage(1, 1, 64, 64) | nothing |
Example · generated
Form 1, the command hands back the id
gradientImage = CreateGradientImage(1, 64, 64)DO Sync()LOOPForm 2, you choose the id yourself
CreateGradient(1, 1)CreateGradientImage(1, 1, 64, 64)DO Sync()LOOPCreateGradientImage 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.