# CustomMessage

Messages
5.1 OC
bool
string message Message to be displayed
object obj If not `nil`, the message is displayed above the specified object.
int plr Player number for which the message should be displayed. Defaults to `NO_OWNER` which will display the message globally.
int offset_x x offset of the message position. For global messages this refers to the viewport center. For object messages this is relative to the standard message position above the object. For portrait messages (portrait!=0) the offset is relative to the upper left viewport corner.
int offset_y y offset of the message position.
int color Color of the message. Default is 0xffffff (white).
id deco ID of the object definition which is used for decoration of the message. If given the message will be surrounded by a border. Only valid for given portrait.
id/object portrait Definition or object to take the graphics from as a portrait.
int flags Bit mask specifying additional options. Possible values:

Bit
Constant
Description
0
MSG_NoBreak
If set no automatic line breaks are inserted for long messages.
1
MSG_Bottom
Global messages only. For portrait messages with decoration frame: The message offset specifies the displacement relative to the bottom of the screen instead of relative to the top. For non-portrait messages the flag displaces the message a bit to the bottom.
2
MSG_Multiple
If set previous messages of the same type will not be removed.

Displays a message.
This function unifies the functionalities of Message and PlayerMessage and offers additional options. To be able to add more parameters in future without having to define a new function it intentionally does not have additionaly format parameters. Instead they can be used via the function Format.
The usual message formating rules apply. If the message starts with an "@" then the message is displayed permanently until it is replaced by another message. The character "|" causes a line break. The message can be formatted using the tags <i> (italic) or <c> (colored).
Messages are displayed until a certain time which depends on the length of the message has passed, or the message is replaced by another message of the same class. A global message (i.e. obj=0) replaces all other global messages, and an object message (obj!=0) replaces all other object messages. To display multiple messages of the same class the flag MSG_Multiple can be used.
CustomMessage("This is <i>madness</i>!",nil,0);
Shows the message "This is madness!" for player 0 only with the word "madness" being written in italic.
CustomMessage("<c ffff00>Tonki:</c> Hello, world", nil, NO_OWNER, 100,100, 0, GUI_MenuDeco, Clonk);
Displays a message with a decoration frame. The name Tonki is colored yellow. On the left hand side of the message a clonk picture will be shown. The decoration definition GUI_MenuDeco needs to be loaded.
Message
PlayerMessage
Sven2
2008-07