TextHitTest

Family: Text · One form

What it does

TextHitTest takes iTextIndex (an integer), x (a float) and y (a float), and answers an integer. iTextIndex is the id of a Text object, the one CreateText returned: it is how the call knows what to act on.

Syntax

TextHitTest(iTextIndex integer, x float, y float) → integer

Parameters

NameType
iTextIndexinteger
xfloat
yfloat

Every form returns

integer

Example · generated

text = CreateText("hello")DO  Print(TextHitTest(text, 100.0, 120.0))  Sync()LOOP

CreateText is there to give the call something to act on; TextHitTest 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