Monogatari Documentation
HomepageGitHubDiscordTwitter
master
master
  • Welcome
  • Getting Started
    • Step 1: Setup Your Environment
    • Step 2: Download Monogatari
    • Step 3: Get Familiarized
    • Step 4: Make Your First Visual Novel
  • Upgrading from v1.4.1
  • F.A.Q.
  • Diagnosing Errors
  • Building Blocks
    • Script & Labels
    • Characters
    • Variables & Data Storage
    • Actions
      • Life Cycle
    • Components
      • Life Cycle
      • Built-in Properties
      • Built-in Functions
  • Script Actions
    • Choices
    • Clear
    • Conditionals
    • Dialogs
    • End
    • Gallery
    • Hide Canvas
    • Hide Character
    • Hide Image
    • Hide Particles
    • Hide Video
    • Input
    • Functions
    • Jump
    • Next
    • Placeholder
    • Play Music
    • Play Sound
    • Play Voice
    • Show Canvas
    • Show Background
    • Show Character
    • Show Image
    • Show Message
    • Show Notification
    • Show Particles
    • Show Scene
    • Show Video
    • Stop Music
    • Stop Sound
    • Stop Voice
    • Vibrate
    • Wait
  • Components
    • Credits Screen
    • Quick Menu
    • Loading Screen
    • Main Screen
    • Choice Container
    • Save Slot
    • Text-Box
  • Configuration Options
    • Game Configuration
      • Asset Preloading
      • Internationalization
      • Saving
      • Skip Main Menu
      • Storage
    • Player Preferences
    • Split Files
  • Style & Design
    • Responsiveness
    • CSS Classes
    • HTML Data Attributes
    • Icons
    • Image Menus
  • Releasing Your Game
    • Chrome App
    • Desktop App
    • Mobile
    • Web
  • Advanced: Monogatari Development
    • Core Libraries
      • Artemis
      • Kayros
      • Pandora
    • Actions
    • Components
    • Translations
    • Events
  • Releases
    • v2.0.0.alpha.8
    • v2.0.0.alpha.7
    • v2.0.0.alpha.6
    • v2.0.0.alpha.5
    • v2.0.0.alpha.4
    • v2.0.0.alpha.3
Powered by GitBook
On this page
  • Description
  • Parameters
  • Configuration
  • Properties
  • Examples
  • Text Message
  • HTML Message

Was this helpful?

  1. Script Actions

Show Message

Show a message

Description

'show message <message_id>'

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.

Monogatari.action ('Message').messages ({
    '<message_id>': {
        title: '',
        subtitle: '',
        body: ''
    }
});

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:

Monogatari.script ({
    'Start': [
        'show message SampleWriting',
        'end'
    ] 
});
Monogatari.action ('Message').messages ({
    'SampleWriting':{
        title: 'Some sample writing',
        subtitle: 'From Evelyn',
        body:'Just look how easy it is!'
    }
});

HTML Message

You can also include HTML on your message, the following script and configuration will show a message with HTML on it.

Monogatari.script ({
    'Start': [
        'show message SampleHTML',
        'end'
    ] 
});
Monogatari.action ('Message').messages ({
    'SampleHTML':{
        title: 'Some sample writing',
        subtitle: 'From Evelyn',
        body: `
            <p>This message is being formatted with HTML</p>
            <img src="assets/images/message.png">
        `
    }
});
PreviousShow ImageNextShow Notification

Last updated 4 years ago

Was this helpful?