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
  • Simple Notification
  • Timed Notification

Was this helpful?

  1. Script Actions

Show Notification

Show a notification to the player

Description

'show notification <notification_id> [time]'

The notification action let's you show a notification to the player. Notifications can be useful for letting them know about a certain event, or even achievement unlock.

Action ID: Notification

Reversible: Yes

Requires User Interaction: If no time was provided, the player will need to dismiss the notification but the game will not be interrupted.

Parameters

Name

Type

Description

notification_id

string

The name of the notification you want to show. These must be declared beforehand using this action configuration functions.

time

number

Optional. The time in milliseconds after which the notification will be automatically dismissed.

Configuration

To show a notification, you must first declare it with all of it's characteristics. To do so, the notification action has a configuration function where you can define your id or name for each notification and their respective information.

Monogatari.action ('Notification').notifications ({
    '<notification_id>': {
        title: '',
        body: '',
        icon: ''
    }
});

Properties

Name

Type

Description

title

string

The title for the notification

body

string

The body of the notification

icon

string

A path to an image that will be shown as the icon for the notification

Examples

Simple Notification

The following script will show a notification that the player will have to manually dismiss.

Monogatari.script ({
    'Start': [
        'show notification SampleNotification',
        'end'
    ] 
});
Monogatari.action ('Notification').notifications ({
    'SampleNotification':{
        title: 'Hey!',
        body: 'This is a notification',
        icon: 'assets/images/notification.png'
    },
});

Timed Notification

The following script will make the notification go away automatically after 5 seconds have elapsed. Remember this action receives the time in milliseconds so we'll use 5000 to dismiss it after the 5 seconds

Monogatari.script ({
    'Start': [
        'show notification SampleNotification 5000',
        'end'
    ] 
});
Monogatari.action ('Notification').notifications ({
    'SampleNotification':{
        title: 'Hey!',
        body: 'This is a notification',
        icon: 'assets/images/notification.png'
    },
});
PreviousShow MessageNextShow Particles

Last updated 4 years ago

Was this helpful?