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
@@ -107,6 +109,35 @@ for (const player of players) {
107
109
}
108
110
```
109
111
112
+
When you chose a specific type for the object in the parameter list, you need to declare the type in the code to get all the autocompletions. For instance, for sprite objects, you will add the following:
You can find the list of all object types in the [GDJS documentation page for RuntimeObject](https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeObject.html).
119
+
120
+
121
+
### Get resources in JavaScript
122
+
123
+
Resource parameters are strings containing the name of the resource. You can get the resource content from some [ResourceManager](https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/interfaces/gdjs.ResourceManager.html).
124
+
125
+
For instance, to get an image for a 2D game you can do as follows:
By default, resource names look like a relative path, but it should not be used as a path because it won't necessarily be a valid path (and it can be changed by users to anything).
140
+
110
141
### Call a library from an event-function
111
142
112
143
After getting the events function parameter values, you can pass them to a JavaScript function.
0 commit comments