Skip to content

Commit 9907d28

Browse files
committed
feat: Add support for generating RPC methods
Add networking demo.
1 parent 598cd82 commit 9907d28

27 files changed

+979
-12
lines changed

example/2d_tutorial/project.godot

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ config_version=5
1212

1313
config/name="simple"
1414
run/main_scene="res://main.tscn"
15-
config/features=PackedStringArray("4.3", "Forward Plus")
15+
config/features=PackedStringArray("4.4", "Forward Plus")
1616
config/icon="res://icon.svg"
1717

1818
[display]
@@ -25,21 +25,21 @@ window/stretch/mode="canvas_items"
2525

2626
move_right={
2727
"deadzone": 0.5,
28-
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
28+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-3,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
2929
]
3030
}
3131
move_left={
3232
"deadzone": 0.5,
33-
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
33+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-3,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
3434
]
3535
}
3636
move_up={
3737
"deadzone": 0.5,
38-
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
38+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-3,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
3939
]
4040
}
4141
move_down={
4242
"deadzone": 0.5,
43-
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
43+
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-3,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
4444
]
4545
}

example/2d_tutorial/src/lib/player.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class Player extends Area2D {
7171
setPosition(position);
7272
}
7373

74+
@GodotRpc()
7475
void start(Vector2 pos) {
7576
setPosition(pos);
7677
show();

example/2d_tutorial/src/pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,14 @@ packages:
199199
path: "../../../src/dart/godot_dart"
200200
relative: true
201201
source: path
202-
version: "0.3.0"
202+
version: "0.6.2"
203203
godot_dart_build:
204204
dependency: "direct dev"
205205
description:
206206
path: "../../../src/dart/godot_dart_build"
207207
relative: true
208208
source: path
209-
version: "0.2.0"
209+
version: "0.4.0"
210210
graphs:
211211
dependency: transitive
212212
description:
@@ -480,4 +480,4 @@ packages:
480480
source: hosted
481481
version: "3.1.2"
482482
sdks:
483-
dart: ">=3.5.0-259.0.dev <4.0.0"
483+
dart: ">=3.5.0 <4.0.0"

example/networking-demo/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Normalize EOL for all files that Git considers text files.
2+
* text=auto eol=lf

example/networking-demo/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Godot 4+ specific ignores
2+
.godot/
3+
/android/
4+
5+
# Ignore built libraries
6+
*.dll
7+
*.lib
8+
*.dylib
9+
*.pdb
10+
*.exp
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[configuration]
2+
3+
entry_symbol = "godot_dart_init"
4+
compatibility_minimum = 4.2
5+
6+
[icons]
7+
8+
DartScript = "res://logo_dart.svg"
9+
10+
[libraries]
11+
12+
windows.x86_64 = "godot_dart.dll"
13+
linux.x86_64 = "libgodot_dart.so"
14+
macos.arm64 = "libgodot_dart.dylib"
15+

example/networking-demo/icon.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://b0g1bchdfioi2"
6+
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://icon.svg"
14+
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1
35+
svg/scale=1.0
36+
editor/scale_with_editor_scale=false
37+
editor/convert_colors_with_editor_theme=false

example/networking-demo/logo_dart.svg

Lines changed: 23 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)