File: CustomMessage.xml

package info (click to toggle)
openclonk 8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 169,520 kB
  • sloc: cpp: 180,479; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 145; sh: 101; javascript: 34
file content (190 lines) | stat: -rw-r--r-- 8,389 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
  SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
  <func>
    <title>CustomMessage</title>
    <category>Messages</category>
    <version>5.1 OC</version>
    <syntax>
      <rtype>bool</rtype>
      <params>
        <param>
          <type>string</type>
          <name>message</name>
          <desc>Message to be displayed</desc>
        </param>
        <param>
          <type>object</type>
          <name>obj</name>
          <desc>If not <code>nil</code>, the message is displayed above the specified object.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>plr</name>
          <desc>Player number for which the message should be displayed. Defaults to <code>NO_OWNER</code> which will display the message globally.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>offset_x</name>
          <desc>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.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>offset_y</name>
          <desc>y offset of the message position.</desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>color</name>
          <desc>Color of the message. Default is 0xffffff (white).</desc>
          <optional />
        </param>
        <param>
          <type>id</type>
          <name>deco</name>
          <desc>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.</desc>
          <optional />
        </param>
        <param>
          <type>proplist</type>
          <name>portrait</name>
          <desc>
            Definition, object or image specification prop list to take the graphics from as a portrait.<br />
            Image specification prop lists can contain the following members:
            <table>
              <rowh>
                <col>Property</col>
                <col>Description</col>
              </rowh>
              <row>
                <col>Source</col>
                <col>Definition to draw graphics of.</col>
              </row>
              <row>
                <col>Name</col>
                <col>Name of graphics to draw from definition. Can be used to show a message e.g. of a skinned clonk. Default graphics are used if not specified.</col>
              </row>
              <row>
                <col>Color</col>
                <col>Color in which ColorByOwner surfaces of definition are drawn.</col>
              </row>
            </table>
          </desc>
          <optional />
        </param>
        <param>
          <type>int</type>
          <name>flags</name>
          <desc>
            Bit mask specifying additional options. Possible values: 
            <table>
              <rowh>
                <col>Bit</col>
                <col>Constant</col>
                <col>Description</col>
              </rowh>
              <row>
                <col>0</col>
                <col>MSG_NoBreak</col>
                <col>If set no automatic line breaks are inserted for long messages.</col>
              </row>
              <row>
                <col>1</col>
                <col>MSG_Bottom</col>
                <col>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.</col>
              </row>
              <row>
                <col>2</col>
                <col>MSG_Multiple</col>
                <col>If set previous messages of the same type will not be removed.</col>
              </row>
			  <row>
                <col>3</col>
                <col>MSG_Top</col>
                <col>Similar to MSG_Bottom. The y-offset is relative to the top of the viewport.</col>
              </row>
			  <row>
                <col>4</col>
                <col>MSG_Left</col>
                <col>Similar to MSG_Bottom. The y-offset is relative to the left of the viewport.</col>
              </row>
			  <row>
                <col>5</col>
                <col>MSG_Right</col>
                <col>Similar to MSG_Bottom. The y-offset is relative to the right of the viewport and the text is aligned to the right.</col>
              </row>
			  <row>
                <col>6</col>
                <col>MSG_HCenter</col>
                <col>Similar to MSG_Bottom. The x-offset is relative to the center of the viewport.</col>
              </row>
			  <row>
                <col>7</col>
                <col>MSG_VCenter</col>
                <col>Similar to MSG_Bottom. The y-offset is relative to the center of the viewport.</col>
              </row>
			  <row>
                <col>8</col>
                <col>MSG_DropSpeech</col>
                <col>Currently not supported.</col>
              </row>
			  <row>
                <col>9</col>
                <col>MSG_WidthRel</col>
                <col>The message width is a percentage of the viewport (0-100).</col>
              </row>
			  <row>
                <col>10</col>
                <col>MSG_XRel</col>
                <col>The x-offset is a percentage of the viewport (0-100).</col>
              </row>
			  <row>
                <col>11</col>
                <col>MSG_YRel</col>
                <col>The y-offset is a percentage of the viewport (0-100).</col>
              </row>
			  <row>
                <col>12</col>
                <col>MSG_Zoom</col>
                <col>The message will be affected by ingame zoom.</col>
              </row>
            </table>

          </desc>
          <optional />
        </param>
		<param>
          <type>int</type>
          <name>width</name>
          <desc>Width of the message. The unit is pixels if MSG_WidthRel is not set as a flag.</desc>
          <optional />
        </param>
      </params>
    </syntax>
    <desc>Displays a message.</desc>
    <remark>This function unifies the functionalities of <funclink>Message</funclink> and <funclink>PlayerMessage</funclink> 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 <funclink>Format</funclink>.</remark>
    <remark>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 &lt;i&gt; (italic) or &lt;c&gt; (colored).</remark>
    <remark>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.</remark>
    <examples>
      <example>
        <code>CustomMessage(&quot;This is &lt;i&gt;madness&lt;/i&gt;!&quot;,nil,0);</code>
        <text>Shows the message "This is madness!" for player 0 only with the word "madness" being written in italic.</text>
      </example>
      <example>
        <code>CustomMessage(&quot;&lt;c ffff00&gt;Tonki:&lt;/c&gt; Hello, world&quot;, nil, NO_OWNER, 100,100, 0, GUI_MenuDeco, Clonk);</code>
        <text>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.</text>
      </example>
    </examples>
    <related>
      <funclink>Message</funclink>
      <funclink>PlayerMessage</funclink>
    </related>
  </func>
  <author>Sven2</author><date>2008-07</date>
</funcs>