BrightSign Object Reference Manual (FW 5.1) User Manual

Page 90

Advertising
background image

82

As with any object that implements the ifStreamSend interface, a text field can be written to using the

PRINT

#textfield syntax. See the example below for more details.

It is also possible to write to a text field using the syntax

PRINT #textfield, @pos, where pos is the character

position in the textfield. For example, if your textfield object has 8 columns and 3 rows, writing to position 17 writes to row
3, column 2 (positions 0-7 are in row 1; positions 8-15 are in row 2; and positions 16-23 are in the last row).

When output reaches the bottom of the text field, it will automatically scroll.

Example:
meta = CreateObject("roAssociativeArray")
meta.AddReplace("CharWidth", 20)
meta.AddReplace("CharHeight", 32)
meta.AddReplace("BackgroundColor", &H101010) ' Dark grey
meta.AddReplace("TextColor", &Hffff00) ' Yellow
vm = CreateObject("roVideoMode")
tf = CreateObject("roTextField", vm.GetSafeX(), vm.GetSafeY(), 20, 20, meta)
print #tf, "Hello World"
tf.SetCursorPos(4, 10)
print #tf, "World Hello"

Advertising