CreateGradientImage

Family: Studio · 2 forms

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) → integer
2
CreateGradientImage(imageID integer, gradientID integer, width integer, height integer)

Parameters

NameTypeIn forms
gradientIDintegerall
widthintegerall
heightintegerall
imageIDinteger2

What each form returns

1gradientImage = CreateGradientImage(1, 64, 64)integer
2CreateGradientImage(1, 1, 64, 64)nothing

Example · generated

Form 1, the command hands back the id

gradientImage = CreateGradientImage(1, 64, 64)DO  Sync()LOOP

Form 2, you choose the id yourself

CreateGradient(1, 1)CreateGradientImage(1, 1, 64, 64)DO  Sync()LOOP

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

106 commands in Studio