Show Message
Show a message

Description

1
'show message <message_id>'
Copied!
The message action let's you show a message to the player. A message is a nice way of showing something that requires more text such as an email or instructions. You could also use it as a mailbox or something of the sorts in your game.
Each message has a close button so the user is able to close it when he's finished reading it.
Action ID: Message
Reversible: Yes
Requires User Interaction: Yes, the user needs to close the message before continuing.

Parameters

Name
Type
Description
message_id
string
The name of the message you want to show. These must be declared beforehand using this action configuration functions.

Configuration

To show a message, you must first declare it with all of it's characteristics. To do so, the message action has a configuration function where you can define your id or name for each message and their respective information.
1
Monogatari.action ('Message').messages ({
2
'<message_id>': {
3
title: '',
4
subtitle: '',
5
body: ''
6
}
7
});
Copied!

Properties

Name
Type
Description
title
string
The title of the message
subtitle
string
A subtitle for the message
body
string
The body or contents of the message

Examples

Text Message

The following script will show a simple text message:
Script
Message Configuration
1
Monogatari.script ({
2
'Start': [
3
'show message SampleWriting',
4
'end'
5
]
6
});
Copied!
1
Monogatari.action ('Message').messages ({
2
'SampleWriting':{
3
title: 'Some sample writing',
4
subtitle: 'From Evelyn',
5
body:'Just look how easy it is!'
6
}
7
});
Copied!

HTML Message

You can also include HTML on your message, the following script and configuration will show a message with HTML on it.
Script
Message Configuration
1
Monogatari.script ({
2
'Start': [
3
'show message SampleHTML',
4
'end'
5
]
6
});
Copied!
1
Monogatari.action ('Message').messages ({
2
'SampleHTML':{
3
title: 'Some sample writing',
4
subtitle: 'From Evelyn',
5
body: `
6
<p>This message is being formatted with HTML</p>
7
<img src="assets/images/message.png">
8
`
9
}
10
});
Copied!
Last modified 2yr ago