For drawing logs to the screen two steps are needed:
Activating the log message listener:
Call DrawLogs.ActivateLogMessageListenerForLogsOnScreen() once. From then on Draw XXL will note all log messages in the background and is able to display them on the screen.
Drawing it:
Call the below documented "DrawLogs.LogsOnScreen()" function once per Update() cycle.
You can also deactivate the log message listener via DrawLogs.DeactivateLogMessageListenerForLogsOnScreen() at any time. Activating and deactivating the listener can e.g. be used to note only those log messages from a certain code block.
Only log messages from the main thread are displayed.
The camera which defines the screenspace can be appointed in several ways. One option is: Every function has an overload that is identical except that it takes a Camera as first parameter. Another more convenient option is: If no Camera is supplied then Draw XXL automatically searches for one according to the global DefaultScreenspaceWindowForDrawing setting (which can point to a Gameview camera or a Sceneview camera). Moreover there is the option to apoint a camera once to the global defaultCameraForDrawing field, which also has the effect that no camera has to be supplied as parameter to the actual draw functions.
Green parameters are required. Yellow parameters are optional, but have to be supplied in order.
static void DrawLogs.LogsOnScreen(...);
Code snippet names: drawLogsOnScreen and drawLogsOnScreen_func.
Parameters:
Type
Parameter Name
Description
bool
drawNormalPrio
bool
drawWarningPrio
bool
drawErrorPrio
This affects not only error messages, but also assertion and exception messages. (so all "red symbol" log types)
int
maxNumberOfDisplayedLogMessages
float
textSize_relToViewportHeight
Color
textColor
bool
stackTraceForNormalPrio
bool
stackTraceForWarningPrio
bool
stackTraceForErrorPrio
This affects not only error messages, but also assertion and exception messages. (so all "red symbol" log types)
float
durationInSec
The duration in seconds how long the drawn thing stays visible. The default value of 0 means that it stays only during the current Update frame. Instead of using this parameter you can also overwrite him with a global setting so you don't always have to supply all other preceding function parameters till you reach this late parameter.
static void DrawLogs.LogsOnScreen(...);
Code snippet names: drawLogsOnScreen_cam and drawLogsOnScreen_cam_func.