Index

SetObjText

SetObjText(<-Unit “ObjName” <-text)

Description

Sets text of a unit's object. Objects are the sub-parts that make up a unit.
When text is set on an object it will show an in-game text field on the object. By default the text will billboard, that is to say it will always face the camera.
To remove text from an object set the text to empty string (“”).

This API and SetUnitDebugText have access to all compatible formats in CW4. If you plan to resize the text, you will need to use the format “<line-height=[Insert number]>” after resizing as the changed size of text will not scale it's line-height correctly without intervention. Typically; “<size=[SOME NUMBER]><line-height=100%>” solves this problem entirely. Unlike SetUnitDebugText however, the line width is not limited and without intervention, the entire String will be displayed as a single line of text. To fix this, be sure to limit the line-width by adding “<br>” to create new lines or limit the left line-margin using “<margin-right=[Insert number]>”.
The full list of formats in CW4 can be found in the A.D.A. Message editor format guide.

Examples

SetObjText(self "text" "I am the very model of a modern major general")

Index