ARDebugMessage
From Blue Mars Developer Guidebook
There are security restrictions on this article
|
|
This is an Avatar Reality Utilities function.
Function
- ARDebugMessage(text, timeout)
- displays text on the screen for timeout seconds
- text - string message to display
- timeout - optional - defaults to five seconds
Usage
Normally you will use the HUD to display nice messages, but for convenient on-screen debug messages you can use this function, or your own custom version. This function will display the text on screen and gradually fade out, and also log the message to the log file, but only if the log_Verbosity console variable is set to 1 or greater, either via the console or using the ARDebug function.
Code
This function uses System.GetCVar to check the value of log_Verbosity and then calls CryAction.Persistant2DText to display the message and System.Log to save the message in the log file.
function ARDebugMessage(text,timeout)
if (System.GetCVar("log_Verbosity")>0) then
if (timeout == nil) then
timeout = 5.0;
end
CryAction.Persistant2DText(text,ARDebugSize,{x=1,y=1,z=1},"ARDebugMessage",timeout);
System.Log(text);
end
end

