Skip to content

ZestPrint

Kevin Cross edited this page Jul 5, 2024 · 2 revisions

Available Functions

ZestPrint(zestText as string, zestWidgetParameters as string)

Adds or updates print line text to an array of print lines. See Available Parameters section below for the options.

ZestUpdatePrintDefaults(zestWidgetParameters as string)

Will overwrite default settings for print lines. See Available Parameters section below for the options.

ZestUpdatePrints()

Displays the print lines on the screen. This function call has been added to ZestSync() so you don't need to call it elsewhere in your code.

Available Parameters (all optional)

Parameter Description
backgroundColor The colour of the text background. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
bold If the text is bold. Accepts the values true, false, 0, and 1.
font The font to apply to the text. Requires a LoadFont() value/id.
padding The x and y padding to go around the text, comma delimited.
printAnchor The position on the screen to anchor the print lines. Accepts the values topLeft (default), topRight, bottomLeft, bottomRight. printAnchor can only be used in ZestUpdatePrintDefaults()
textColor The colour of the text. Accepts RGB values, and RGBA values (comma delimited) Also accepts MakeColor() value/id, and hex color codes.
textSize The size of the text. Accepts decimals.

Example Code

Example

ZestUpdatePrintDefaults("backgroundColor:255,255,255,180;textColor:0,0,0,255;printAnchor:bottomLeft")

do
	ZestPrint("Zest Print Line 1", "") // Will use default settings
	if (GetRawKeyState(32))
		ZestPrint("Space Held Down", "bold:true;textColor:0,0,255,255;textSize:50;backgroundColor:0,255,0,150;padding:10,20")
	endif
	ZestPrint("Zest Print Line 2", "textColor:0,0,0,255;backgroundColor:255,255,0,150")
	
	ZestPrint(str(ScreenFPS()), "bold:false;textColor:0,0,255,255;textSize:25;backgroundColor:0,255,255,180")
	
	ZestPrint("Virtual Resolution = " + str(GetVirtualWidth()) + "," + str(GetVirtualHeight()), "padding:10,5;textSize:28;textColor:0,0,0,255;backgroundColor:255,0,0,180")
	
	ZestSync()
loop

Clone this wiki locally