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
After this action, all required files should be generated, and you can safely build the project using the `Build` button at the top-right of the editor window.
Copy file name to clipboardExpand all lines: docs/src/doc/index.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,25 @@ If you don't have Discord or you don't want to use it, please file an issue on G
39
39
40
40
The main language supported is Kotlin. We do however support Java experimentally. It should be possible to support other JVM-based languages as well but this is not the focus of this project. If you want to have support for other languages, have a look at [support for other JVM-based languages](contribution/support-for-other-jvm-based-languages.md).
41
41
42
-
## Supported Kotlin version
42
+
## Supported platforms
43
+
44
+
While Kotlin and Godot supports a wide range of platforms, this module for the moment only supports the following:
45
+
46
+
- Windows X64
47
+
- Linux X64
48
+
- MacOS X64 / arm64
49
+
- Android (arm64v8)
50
+
- iOS (arm64v8)
51
+
52
+
## Versioning
53
+
54
+
The module uses semantic versioning for its own versions but adds a suffix for the supported Godot version:
55
+
56
+
Full version: `0.10.0-4.3.0`
57
+
58
+
Module Version: `0.10.0`
59
+
60
+
Supported Godot Version: `4.3.0`
43
61
44
62
This module relies on a Kotlin *compiler plugin* for registering your classes and members to Godot. As the compiler API from Kotlin is not stable yet, at the moment we can only support specific Kotlin version per release.
Copy file name to clipboardExpand all lines: docs/src/doc/user-guide/advanced/gradle-plugin-configuration.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,11 @@ This is due to the fact that the Kotlin compiler plugin API is not stable yet. T
6
6
But if you are familiar with the quirks of compiler plugins and their compatibility and you need to use another Kotlin version than we officially support,
7
7
you can disable the version checks we have in place in our Gradle plugin. To do this you have to set `godot.jvm.suppressKotlinIncompatibility` to `true` in the `gradle.properties` file:
8
8
9
-
=== "gradle.properties"
10
-
```
11
-
godot.jvm.suppressKotlinIncompatibility=true
12
-
```
9
+
/// tab | gradle.properties
10
+
```kotlin
11
+
godot.jvm.suppressKotlinIncompatibility=true
12
+
```
13
+
///
13
14
14
15
!!! warning
15
16
This is an advanced feature! Only use it if you know what you're doing. We cannot guarantee that our compiler plugin is compatible with other kotlin versions than the one we build it for. Setting this property to true can lead to build and/or runtime errors.
Copy file name to clipboardExpand all lines: docs/src/doc/user-guide/api-differences.md
+29-24Lines changed: 29 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,13 +125,6 @@ dictionary.get("foo") {
125
125
126
126
Godot enums are mapped to Kotlin enums, the generated enum exposes a `value` property that represents the value in Godot. Constants in Godot classes that represent an enum value (such as `Node.PAUSE_MODE_INHERIT`) are not present in this module, please use the generated enum instead (`Node.PauseMode.INHERIT`).
127
127
128
-
## Signals and exposed methods
129
-
130
-
In GDScript, signals can have any number of arguments, this is not possible in Kotlin as it is a statically typed language.
131
-
At the moment, you can create signals and expose them to Godot with at most 10 parameters.
132
-
133
-
If you need more than 10 parameters, you can either use the not typesafe function `connect(signalAsString, targetObject, targetMethodAsString)` and the corresponding emit function or you can write your own typesafe extension functions like we did, to further increase the supported arg count. Keep in mind that you pass in the converted function and signal names (snake_case) to the above mentioned functions.
134
-
135
128
## Renamed symbols
136
129
137
130
To avoid confusion and conflict with Kotlin types, the following Godot symbol is renamed.
@@ -166,33 +159,45 @@ override fun _notification() = godotNotification {
166
159
```
167
160
Currently this feature except abstract classes.
168
161
169
-
## Caching
162
+
## StringName and NodePath
170
163
171
164
Several Godot functions take `StringName` or `NodePath` as a parameter.
172
-
It's often more convenient to directly use a String that need to be converted.
165
+
It's often more convenient to directly use a String and convert it.
173
166
174
-
This operation can be costly so we provide extension functions which cache the result of the conversion for later calls:
175
-
176
-
-`String.asCachedStringName()`
177
-
-`String.asCachedNodePath()`
178
-
-`StringName.asCachedNodePath()`
167
+
This kind of operation can be costly so we provide extension functions which cache the result of the conversion for later calls:
179
168
169
+
/// tab | Kotlin
180
170
```kotlin
181
-
// This first call to the extension function creates the cache entry.
182
-
valfirstCall="Test".asCachedStringName()
183
-
184
-
// This second call for the same String value, will return the previously cached instance.
185
-
val secondCall ="Test".asCachedStringName()
171
+
val stringName ="myString".asCachedStringName() // Cache the string for faster future calls.
172
+
valnodePath="myNode/myChildNode".asCachedNodePath() // Cache the string for faster future calls.
173
+
val snakeCaseStringName ="myString".toGodotName() // Convert the string to snake_case and cache it for faster future calls.
174
+
```
175
+
///
186
176
187
-
// This third call will create a second entry in the cache due to the different key value.
0 commit comments