Draw XXL documentation


Draw Engine Basics.TagGameObjectScreenspace(...);

Similarly to TagGameObject(): Use this to easily tag a GameObject with text information from anywhere in your code. It marks the GameObject with a box and displays the tag text alongside. The difference is: The tag box is no 3D box, but a 2D box in screenspace and you get an optional pointer on the screen border if the GameObject is out of sight.

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 DrawEngineBasics.TagGameObjectScreenspace(...);

Code snippet names: drawTagGameObjectScreenspace and drawTagGameObjectScreenspace_func.

Parameters:
Type Parameter Name Description
GameObject gameObject
string text
Color colorForText
Color colorForTagBox
float linesWidth_relToViewportHeight
bool drawPointerIfOffscreen
float relTextSizeScaling
bool encapsulateChildren
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 DrawEngineBasics.TagGameObjectScreenspace(...);

Code snippet names: drawTagGameObjectScreenspace_cam and drawTagGameObjectScreenspace_cam_func.

Parameters:
Type Parameter Name Description
Camera screenCamera This parameter is the only difference to the previous overload. It specifies the camera explicitly instead of relying on DefaultScreenspaceWindowForDrawing or defaultCameraForDrawing.
GameObject gameObject
string text
Color colorForText
Color colorForTagBox
float linesWidth_relToViewportHeight
bool drawPointerIfOffscreen
float relTextSizeScaling
bool encapsulateChildren
float durationInSec