These properties and functions are related to the print box, and the way it is displayed on the screen. The print box pops up in the middle of the screen to display formatted text for the user to read. It can be used for narration of the game, and to print out information for debugging a game during development.
Properties
Functions
property PrintingColor = COLOR_WHITE
Color of print box background.
property PrintingBorderColor = COLOR_BLACK
Color of print box border.
property PrintingFont = none
Font used to print text. If none is specified, defaultFont is used.
property PrintingJustify = 0
Justification of text printed inside the box.
NotesThe constants JUSTIFY_LEFT, JUSTIFY_RIGHT, and JUSTIFY_CENTER are defined in the standard script file "Constants.s".
property PrintingMargin = 20
Space in pixels between the text and the edge of the box.
property PrintingStyle = 0
Style of the print box.
NotesThe style constants STYLE_SOLID, STYLE_TRANS, STYLE_SHADED and STYLE_CLASSIC are defined in the standard script file "Constants.s".
property PrintingTextColor = COLOR_BLACK
Color of the text inside the box.
function InstallPrintingHandler (HandlerScriptIndex)
Overrides the automatic drawing of the print text box with a programmer-defined script.
Parameters
HandlerScriptIndex | | Index of the script to use as the drawing handler. It must accept four arguments, which are the absolute screen coordinates of top-right and bottom-left of the box. |
Examplescript myPrintingHandler (x1, y1, x2, y2)
{
drawingColor = BLUE; drawShadeRect(x1, y1, x2, y2);
drawingColor = WHITE; drawRect(x1, y1, x2, y2);
drawingColor = BLACK; drawRect(x1-1, y1-1, x2+1, y2+1);
}
event main
{
installPrintingHandler(&myPrintingHandler);
}
|