Table of Contents
Time and User Labels
ITime is documented in the main docs: Time And Difficulty. Mission scripts use Mission.Time or GamePlay.gpTime(). GPUserLabel and GPUserIconType are used with IGamePlay user-label methods (gpMakeUserLabel, gpDrawUserLabel, gpDeleteUserLabel) and in OnUserCreateUserLabel / OnUserDeleteUserLabel.
ITime (cross-link)
Kind: interface
See Time And Difficulty for the full ITime API: current(), currentReal(), tick(), SecsToTicks, TicksToSecs, isPaused(), etc.
Access in mission scripts: Mission.Time or GamePlay.gpTime().
GPUserIconType
Kind: enum
Icon type for a user map label.
| Value | Description |
|---|---|
Waypoint |
Waypoint. |
Plane |
Plane. |
AAGun |
AA gun. |
Ship |
Ship. |
Factory |
Factory. |
Tank |
Tank. |
Car |
Car. |
Label |
Label. |
Use when creating a label with GamePlay.gpMakeUserLabel(Point2d pos, Player Player, string Text, double Time, int type) (pass the enum value or equivalent int).
GPUserLabel
Kind: interface
Represents a user-created map label. Created with GamePlay.gpMakeUserLabel(); drawn/deleted with gpDrawUserLabel / gpDeleteUserLabel. Passed to OnUserCreateUserLabel and OnUserDeleteUserLabel.
| Member | Type | Description |
|---|---|---|
pos |
Point2d | Position (get/set). |
Player |
Player | Player (get/set). |
Text |
string | Label text (get/set). |
time |
double | Time (get/set). |
type |
int | Icon type, e.g. GPUserIconType (get/set). |
Usage
- Create:
var ul = GamePlay.gpMakeUserLabel(pos, player, text, time, (int)GPUserIconType.Waypoint); - Show:
GamePlay.gpDrawUserLabel(ul);or overloads for specific players/army. - Remove:
GamePlay.gpDeleteUserLabel(ul);or overloads. - In OnUserCreateUserLabel(ul) / OnUserDeleteUserLabel(ul) you can read or modify label data as needed.