...
header
text
- header title(optional)
page
by default, each element is on page
default
; it can be assigned another page by changing the name of the page
button
generating a button with a certain
name
execute an
action
with some presetdata
(optional) have on of the
style
from: [primary, secondary, success, danger, warning, info, light, dark]) to change its appearance(optional) execute multiple actions with one button by adding additional parameters
action_1
anddata_1
,action_2
anddata_2
etc.(optional)
{0}; {1}; {2};
etc. for taking input and replacing the button output accordinglythe same parameter (e.g.:
{0}
) can be used more than once in the data string
(optional)
page
(optional)
next
to switch to another page upon press
Make sure that the JSON file is valid (using e.g. http://json.parser.online.fr).
...
An example of a JSON configuration file can be found below:
Code Block | ||||
---|---|---|---|---|
| ||||
[ { "type": "header", "text": "Hello Goodbye" }, { { "type": "button", "style": "success", "name": "SayHello", "action": "action_say_animated", "data": "Hello, {0}!" }, { { "type": "button", "style": "danger", "name": "SayBye", "action": "action_say_animated", "data": "Goodbye!" }, { { "type": "button", "name": "Sing", "action": "action_say", "data": "You say yes, I say no, you say stop, and I say go, go, go. You say goodbye, and I say hello.", "next": "page_2" }, { { "type": "header", "text": "Other Stuff", "page": "page_2" }, { "type": "button", "name": "Wave", "action": "action_gesture", "data": "animations/Stand/Gestures/Hey_1", "page": "page_2" }, { { "type": "button", "name": "Rainbow", "action": "action_eyecolour", "data": "rainbow", "next": "default", "page": "page_2" }, { { "type": "button", "style": "warning", "name": "Tablet", "action": "render_html", "data": "<img src=\"https://www.softbankrobotics.com/emea/sites/default/files/images-content/Pepper_8.png\">", "page": "page_2" } ] |
This The configuration file would be rendered to the pictures below:
...
the button “SayHello” would prompt for the name of the user input, so that “Hello, [name]” is used in TTS
upon press, the button “Sing” would trigger its singing action and then switch to
page_2
...
Events
Events are generated depending on the services used. For more information, check the respective service page.
...