TextCharY

Family: Text · 2 forms

What it does

TextCharY takes iTextIndex (an integer) and iCharIndex (an integer), and answers a float. That is the first of 2 forms. iTextIndex is the id of a Text object, the one CreateText returned: it is how the call knows what to act on.

Syntax

1
TextCharY(iTextIndex integer, iCharIndex integer) → float
2
TextCharY(iTextIndex integer, iCharIndex integer, y float)

Parameters

NameTypeIn forms
iTextIndexintegerall
iCharIndexintegerall
yfloat2

What each form returns

1TextCharY(text, char)float
2TextCharY(text, char, 120.0)nothing

Example · generated

Form 1, the command hands back the id

text = CreateText("hello")char = CreateTweenChar(1.0)DO  Print(TextCharY(text, char))  Sync()LOOP

Form 2, you choose the id yourself

text = CreateText("hello")char = CreateTweenChar(1.0)TextCharY(text, char, 120.0)DO  Sync()LOOP

CreateText and CreateTweenChar are there to give the call something to act on; TextCharY is the line that matters. 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.

68 commands in Text