DisplayNotification

DisplayNotification

How to add to:         dialogue nodes

                        the script editor

                        onClick

Features from version 2.7

Dialogue Nodes

 

You can add the commands directly into a dialogue node or into the dialogue text (found in the properties section). Here’s an example:

[action:"displayNotification", message:"You just found a diamond!"]

 Script Editor

You can add the commands into the script editor at the bottom of the screen. Here’s an example:

LB.Actions.displayNotification({message:"You just found a diamond!"});

OnClick

1.) Select the asset that you want to click in order to display the notification (in this case, it’s an item)

2) Add the command into the onClick section in the Properties panel

 

{"action":"displayNotification", "message":"You just found a diamond!"}

 

Possible problem:  there is no “onClick” section in the Properties panel

The onClick section is because a CAF (Custom Asset Field) has been created manually. If it is not present, you can add it to your cmp:

->Top toolbar, select “Project”

->Project settings

This box will pop up:

 

-> Click the “Custom Asset Fields” tab (1)

-> Click on the tab you want to add the CAF to (2)

(in this case it’s to an item, but you could add it to an actor, location, etc

depending on your needs for the scenario)

-> Click on the “Add New Field” button (3)

        -> Type in “onClick” (it’s case sensitive)

                -> Leave the Type as “text”

                        -> Click “OK”

Now the onClick CAF has been added, you can add in the command as explained earlier.

 

 

Features from Version 2.7

From the 2.7 version of the platform, it is possible to change both the colour of the notification and the text in the “ding” button.

To change the colour, add in a parameter of “type”:

LB.Actions.displayNotification({message:"You just found a diamond!", type:"primary"});

To change the text in the button, add in a parameter of “badgeText”:

LB.Actions.displayNotification({message:"You just found a diamond!", badgeText:"Yay!"});

How useful was this article?

Click on a star to rate it!

We are sorry that this article was not useful for you!

Let us improve this article!

Tell us how we can improve this article?