Version 0.3.0
[minetest_central_message.git] / README.md
blobd04eb25dfe274ae3087a659f66cc525d250b029c
1 # Central Message
2 ## Overview
3 * Description: Simple API to display short messages at the center of the screen
4 * Author: Wuzzy
5 * License of everything: WTFPL
6 * Shortname: `central_message`
7 * Version: 0.3.0 (using Semantic Versioning 2.0.0, see [SemVer](http://semver.org/))
9 ## Longer description
10 This Minetest mod allows other mods to display a short message at the center of the screen.
11 Each message is displayed for a few seconds, then it is removed.
12 When multiple messages are pushed quickly in succession, the messages will be “stacked”
13 on the screen.
15 This mod can be useful to inform about all sorts of events and is an alternative to use the chat log
16 to display special events.
18 Some usage examples:
20 * Messages about game events, like victory, defeat, next round starting, etc.
21 * Error message directed to a single player
22 * Informational messages
23 * Administational messages to warn players about a coming server shutdown
25 ## Settings
26 This mod can be configured via `minetest.conf`.
28 Currently, these settings are recognized:
30 * `central_message_max`: Limit the number of messages displayed at once, by providing a number. Use `0` for no limit. Default: `7`
31 * `central_message_time`: How long (in seconds) a message is shown. Default: `5`
32 * `central_message_color`: Set the message color of all messages. Value must be of format `(R,G,B)`. Default: `(255,255,255)` (white).
35 ## API
36 ### `cmsg.push_message_player(player, message)`
37 Display a new message to one player only.
39 #### Parameters
40 * `player`: An `ObjectRef` to the player to which to send the message
41 * `message`: A `string` containing the message to be displayed to the player
43 #### Return value
44 Always `nil`.
47 ### `cmsg.push_message_all(message)`
48 Display a new message to all connected players.
50 #### Parameters
51 * `player`: An `ObjectRef` to the player to which to send the message
52 * `message`: A `string` containing the message to be displayed to all players
54 #### Return value
55 Always `nil`.