You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/inAppTutorial/REFERENCE.md
+29-5
Original file line number
Diff line number
Diff line change
@@ -91,16 +91,17 @@ A step is more or less an element to highlight plus a trigger that can be detect
91
91
92
92
Here is the structure of a step (all fields are optional):
93
93
94
-
- `id` (string): Id of the step (useful for shortcuts and editor switches)
94
+
- `id` (string): id of the step (useful for shortcuts and editor switches)
95
95
- `elementToHighlightId` (string): the CSS selector of the element to highlight
96
-
- `nextStepTrigger`: See [Triggers](#triggers)
97
-
- `tooltip`: See [Tooltip](#tooltip)
98
-
- `isTriggerFlickering`(true): Useful when a DOM mutation is not caught and the presence trigger is not fired.
99
-
- `shortcuts`: List of steps that the flow can use as shortcuts.
96
+
- `nextStepTrigger`: see [Triggers](#triggers)
97
+
- `tooltip`: see [Tooltip](#tooltip)
98
+
- `isTriggerFlickering`(true): useful when a DOM mutation is not caught and the presence trigger is not fired.
99
+
- `shortcuts`: list of steps that the flow can use as shortcuts.
100
100
- `stepId`: id of the step to jump to
101
101
- `trigger`: DOM trigger (presence of absence of element)
102
102
- `skippable` (true): if the step can be skipped (useful when the user interaction can result in this step not being mandatory)
103
103
- `isOnClosableDialog` (true): if the step is on a closable dialog, if the element to highlight is missing (meaning the dialog has been closed), the flow will go back to the previous step that is not on a closable dialog.
104
+
- `mapProjectData` (object): allow to read data in the GDevelop project object and store it during the duration of the tutorial. This data can then be used in the tooltips. See [Available Project Data](#available-project-data)
104
105
105
106
#### **Triggers**
106
107
@@ -117,6 +118,27 @@ Notes:
117
118
118
119
- You can learn about CSS selectors [here](https://www.w3schools.com/cssref/css_selectors.asp).
119
120
121
+
#### **Available Project Data**
122
+
123
+
Project data is read when the step is complete. Here is how to construct `mapProjectData`:
124
+
125
+
- For each item of the object:
126
+
- the key of the object is the string under which to store the data
127
+
- the value is the "data accessor"
128
+
- At the moment, there is only one available data accessor:
129
+
- `lastProjectObjectName` that will read the name of the last object added to the project.
130
+
131
+
Example: This will store the name of the last object added to the project under the key `firstObject`:
132
+
133
+
```json
134
+
{
135
+
...,
136
+
"mapProjectData": {
137
+
"firstObject": "lastProjectObjectName",
138
+
}
139
+
}
140
+
```
141
+
120
142
#### **Tooltip**
121
143
122
144
For each step, you can specify a tooltip to display next to the element you want to highlight. A tooltip contains the 3 following fields:
@@ -128,6 +150,8 @@ For each step, you can specify a tooltip to display next to the element you want
128
150
Notes:
129
151
130
152
- At least one field among `title` and `description` should be provided. If you don't want to display a tooltip, do not provide the `tooltip` field in your step.
153
+
- To use data stored with `mapProjectData`, include the placeholder `$(...)` in your text.
154
+
- For example, the description `"Drag $(firstObject) to the scene"` will be displayed `"Drag Platformer to the scene"`.
0 commit comments