Name
Print -- print data to the screen
Synopsis
Print(var, ...)
Function
Prints the data specified by var to the screen. This function can handle all different data types: You can print strings, numbers, tables, functions. The data is printed at the current cursor position which you can modify by calling Locate().

This function uses word-wrapping, e.g. when the margin is reached and a word cannot be printed in the same line, it will insert a line break automatically. You can manually set the margins by using the SetMargins() function. Starting with Hollywood 9.1, you can also use soft hyphens or zero-width space characters to customize word wrapping but since these are Unicode characters, you need to make sure that you use UTF-8 encoding in that case.

This function also respects your tabulator settings. If you print a string which contains a tabulator char ("\t"), print will jump to the next tabulator position. You can define the tabulator settings with the AddTab() and ResetTabs() commands.

You can also specify escape codes here. See String data type for details.

If layers are enabled this command will add a new layer of the type #PRINT to the layer stack.

Starting with Hollywood 2.0 you can pass as many arguments as you want to this function. If you pass multiple arguments to this function, they will be printed with a space to separate them.

Starting with Hollywood 2.5 you can use format tags in the string you pass to Print(). 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.

Besides Print(), you can also use the functions NPrint() and TextOut() to draw text to the screen.

Note that when drawing to a palette-based target and the palette mode is set to #PALETTEMODE_PEN, this function will draw using the pen set via SetDrawPen() instead of the font color set using SetFontColor().

Inputs
var
data to print
...
other arguments (V2.0)
Example
Print("Hello World!")
Prints "Hello World!" to the screen at the current cursor position.

Show TOC