SC2Mapster.com Wiki

SC2 API / Functions / UIDisplayMessage

UIDisplayMessage

void UIDisplayMessage(playergroup group, int area, text message);

Display a message in players UI

Parameters

playergroup group

Group of players that are going to receive the message

int area

Position where the message will be displayed. Available areas:

IntegerGUI NameMessage Area Constant
0None
1Chat Messagec_messageAreaChat
2Notice (Top Left)
3Error, Red (Bottom Left)c_messageAreaError
4Subtitlec_messageAreaSubtitle
5Minimap / Cinematic (Covers the UI)c_messageAreaCinematic
6Debug, (Bottom Left)c_messageAreaDebug

Some other available areas: c_messageAreaObjective, c_messageAreaDirective, c_messgaeAreaWarning

See the attached file to have a preview

text message

Message to be displayed. If you want to display a string, you first have to convert it with the function StringToText(string s)

Examples

Example #1: Initialization Trigger
// Send a message to everyone in the subtitle area
UIDisplayMessage(PlayerGroupAll(),
                 c_messageAreaSubtitle,
                 StringToText("Hello From SC2 Mapster"));
Example #2: Clear screen area
// Fill an area with a lot of blanks to remove all the messages
// currently active in that area
void UIClearScreenArea(int area) {
  int i = 0;
  while (i <= 20) {
    UIDisplayMessage(PlayerGroupAll(), area, StringToText(" "));
    i += 1;
  }
}
  • uidisplaymessageareas.PNG

You must login to post a comment. Don't have an account? Register to get one!

  • 1 comment
  • Avatar of BanditKeith BanditKeith May 08, 2010 at 08:13 UTC - 0 likes

    It's probably not a good idea to provide the hard coded numbers for the locations, since there is no guarantee that they will remain the same. The safer bet is to use the associated constants for each location.

  • 1 comment

Facts

Date created
Mar 02, 2010
Last updated
May 08, 2010