~~NOTOC~~ <=[[4rpl:start| 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 "" after resizing as the changed size of text will not scale it's line-height correctly without intervention. Typically; "" 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 "
" to create new lines or limit the left line-margin using "".\\ The full list of formats in CW4 can be found in the [[cw4:a.d.a_syntax_syntax_guide|A.D.A. Message editor format]] guide. ===== Examples ===== SetObjText(self "text" "I am the very model of a modern major general") <=[[4rpl:start| Index]]