CreateTweenSprite

Family: Tweening · 2 forms

What it does

CreateTweenSprite brings a Tweening object into being: it is how the rest of the program comes to have one. It takes tweenID (an integer) and duration (a float), and returns nothing. That is the first of 2 forms. tweenID is the id you are giving a Tween object: every later call names it by that number.

Syntax

1
CreateTweenSprite(tweenID integer, duration float)
2
CreateTweenSprite(duration float) → integer

Parameters

NameTypeIn forms
tweenIDinteger1
durationfloatall

What each form returns

1CreateTweenSprite(1, 1.0)nothing
2tweenSprite = CreateTweenSprite(1.0)integer

Example · generated

Form 1, you choose the id yourself

CreateTweenSprite(1, 1.0)DO  Sync()LOOP

Form 2, the command hands back the id

tweenSprite = CreateTweenSprite(1.0)DO  Sync()LOOP

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

149 commands in Tweening