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: README.md
+36-17Lines changed: 36 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@ And I want to use it in Godot.
10
10
11
11
> [!NOTE]
12
12
> This extension is compatible with Godot 4.2+. Global Classes require Godot 4.3
13
+
>
14
+
> There are major changes to the entire library starting in `godot_dart` 0.10.0, which uses Dart 3.8.
15
+
> Previously, `godot_dart` upgraded to 0.9.0 without these changes and is therefore broken.
13
16
14
17
15
18
Here's a list of planned features and work still to be done ( ✅ - Seems to be
@@ -68,6 +71,7 @@ part 'simple_script.g.dart';
68
71
@GodotScript()
69
72
class SimpleScript extends Sprite2D {
70
73
// Return the type info that was generated...
74
+
@pragma('vm:entry-point')
71
75
static TypeInfo get sTypeInfo => _$SimpleScriptTypeInfo();
72
76
// And provide an instance method to get the type info
73
77
@override
@@ -159,29 +163,34 @@ These signal connections are automatically cleaned up if the target supplied to
159
163
160
164
## Dart classes as Extensions
161
165
162
-
Here's a Simple example class that can be used as an extension.
166
+
Dart classes as extensions have had major changes in `godot_dart` 0.10.0, and are currently a work in progress. Their setup is basically the same as Scripts, except all of the type registration must be done manually.
163
167
164
168
```dart
165
-
class Simple extends Sprite2D {
169
+
class SimpleTestNode extends Sprite2D {
166
170
// Create a static `sTypeInfo`. This is required for various Dart methods
167
171
// implemented in C++ to gather information about your type.
168
-
static late TypeInfo sTypeInfo = TypeInfo(
169
-
Simple,
170
-
StringName.fromString('Simple'),
171
-
parentClass: StringName.fromString('Sprite2D'),
172
-
// a vTable getter is required for classes that will be used from extensions.
173
-
// If you are not adding any virtual functions, just return the base class's vTable.
174
-
vTable: Sprite2D.sTypeInfo.vTable;
172
+
static final sTypeInfo = ExtensionTypeInfo<SimpleTestNode>(
Copy file name to clipboardExpand all lines: src/dart/godot_dart/CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
## 0.10.0
2
+
3
+
- BREAKING: Fix extension to work with more restrictive native calls in Dart 3.8.
4
+
- For scripts, `godot_dart_build` should do most migration for you, but you need to add `@pragma('vm:entry-point')` onto your declaration for `sTypeInfo` in all script classes
5
+
- Extension classes very different, and it is recommended to avoid using them for now.
0 commit comments