CreateTextForZone
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | createTextForZone | |
| Function Description: | Creates a text marker for a specified zone with customizable text and colour, positioned relative to the zone's center. The function retrieves the zone's position and radius, calculates an offset based on text length, and sets the text appearance using predefined colour schemes. It returns a marker ID if successful, or logs an error if the zone is not found or invalid colour is specified. | |
| File Location: | cmm.ZoneFunctions.lua | |
| Syntax: | CMM.createTextForZone( string zoneName , string text , string zoneId , string colour ) | |
| Return Value: | number or nil | |
| Parameters: | Name | Description |
| zoneName | Name of the zone as defined in the mission editor. | |
| text | Text content to display on the zone marker. | |
| zoneId | Zone identifier used internally; may be redundant or for future compatibility with Dagi's system. --TODO Unknown why this is used Ask Dagi | |
| colour | Colour of the text, must be one of "red", "blue", "green", or "black"; defaults to red if unspecified. | |
| Example: | CMM.createTextForZone("Zone15", "Red Zone", "Z15", "red") | |
| Example Description: | Creates a red text marker labeled "Red Zone" for the zone named "Zone15", positioned offset from the zone center based on text length, and returns the marker ID for reference. | |
| Related Functions: | ||
| Notes: | ||