TextOut(x, y, text$[, table])
text$to the position specified by coordinates
y. This function has the advantage that you can use Hollywood's special constants as the coordinates (e.g.
#BOTTOM...) which is not possible with Print() because the Locate() function does not handle them.
If layers are enabled, this command will add a new layer of the type
#TEXTOUT to the layer stack.
Starting with Hollywood 2.5, you can use format tags in the string
you pass to
TextOut(). Using these tags you can control the font
style and color of your text on-the-fly. Format tags always
start and end with a square bracket ('['). In case you just
want to print a square bracket, you will have to use two square
brackets. If there is only one square bracket Hollywood will
always expect a format tag. See Format tags for details.
In Hollywood 4.0 the syntax of this function changed slightly. While the old syntax is still supported for compatibility, new scripts should use the new syntax which accepts a table as argument 4. The table can contain the following elements:
The default value for
TextOut()can do automatic word-wrapping for you if you specify this additional parameter. You can use this parameter to specify a maximum width for your text.
TextOut()will then use word wrapping to make sure that no text runs beyond this limit. If you do not set this argument or set it to 0 (which is also the default), the text will be as wide as it is required.
text$. This defaults to the text library default encoding as set by SetDefaultEncoding()). See SetDefaultEncoding for details. (V4.7)
TextOut()will use the color value that was set using the SetFontColor() command instead. (V5.0)
Furthermore, the optional table argument can also contain one or more of the standard tags for all drawing commands. See Standard draw tags for details.
Note that Hollywood currently only supports standard left-to-right based text aligned on horizontal lines. Right to left and vertical text is currently not supported.
TextOut(#CENTER, #CENTER, "Hello World!") WaitLeftMouse Undo(#TEXTOUT)The above code prints "Hello World!" in the center of your display. Then it waits for the left mouse button and removes the "Hello World!" from the display.