Skip to content

Commit 5a0f24f

Browse files
committed
Update CI, examples and ReadMe to Godot 3.4
1 parent 4946307 commit 5a0f24f

File tree

4 files changed

+46
-23
lines changed

4 files changed

+46
-23
lines changed

.github/workflows/full-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ env:
3232

3333
# Local variables
3434
# Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480
35-
GODOT_VER: '3.3'
35+
GODOT_VER: "3.4"
3636
GODOT_REL: stable
3737

3838
on:

.github/workflows/minimal-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212

1313
# Local variables
1414
# Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480
15-
GODOT_VER: "3.3"
15+
GODOT_VER: "3.4"
1616
GODOT_REL: stable
1717

1818
on:

README.md

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,22 @@
1212

1313
## Stability
1414

15-
The bindings cover most of the exposed API of Godot 3.2, and are being used on a number of projects in development, but we still expect non-trivial breaking changes in the API in the coming releases. godot-rust adheres to [Cargo's semantic versioning](https://doc.rust-lang.org/cargo/reference/semver.html).
15+
The bindings cover most of the exposed API of Godot 3.4, and are being used on a number of projects in development, but we still expect non-trivial breaking changes in the API in the coming releases. godot-rust adheres to [Cargo's semantic versioning](https://doc.rust-lang.org/cargo/reference/semver.html).
1616

1717
## Engine compatibility
1818

19-
We are committed to keeping compatibility with the latest stable patch releases of all minor versions of the engine, starting from Godot 3.2.
19+
We are committed to keeping compatibility with the latest stable patch releases of all minor versions of the engine, starting from Godot 3.2:
20+
* Godot 3.4 (works out-of-the-box)
21+
* Godot 3.3 (needs api.json adjustment)
22+
* Godot 3.2 (needs api.json adjustment)
2023

21-
The current minimum compatible version, with `api.json` replacement, is Godot 3.2. Godot 3.3 is supported as well. Changes to this will be considered a breaking change, and will be called out in the release notes.
24+
For versions 3.2 and 3.3, some extra steps are needed, see _Custom builds_ below.
2225

23-
The bindings do _**not**_ support Godot 4.0 currently. Support is planned as the native extensions become more stable.
26+
The bindings do _**not**_ support in-development Godot 4 versions at the moment. Support is planned as the native extensions become more stable.
2427

2528
## Requirements
2629

27-
The generator makes use of `bindgen`, which depends on Clang. Instructions for installing `bindgen`'s dependencies for popular OSes can be found in their documentation: https://rust-lang.github.io/rust-bindgen/requirements.html.
30+
The generator makes use of `bindgen`, which depends on Clang. Instructions for installing `bindgen`'s dependencies for popular OSes can be found [in their documentation](https://rust-lang.github.io/rust-bindgen/requirements.html).
2831

2932
`bindgen` may complain about a missing `llvm-config` binary, but it is not actually required to build the `gdnative` crate. If you see a warning about `llvm-config` and a failed build, it's likely that you're having a different problem!
3033

@@ -40,10 +43,22 @@ This means that `bindgen` was unable to find the C system headers for your platf
4043

4144
## Usage
4245

43-
### Godot 3.2.3-stable
46+
### Latest `master` version + Godot 3.4
4447

4548
After `bindgen` dependencies are installed, add the `gdnative` crate as a dependency, and set the crate type to `cdylib`:
4649

50+
```toml
51+
[dependencies]
52+
gdnative = { git = "https://github.com/godot-rust/godot-rust.git" }
53+
54+
[lib]
55+
crate-type = ["cdylib"]
56+
```
57+
58+
### Godot 3.2.3-stable
59+
60+
To access the last released version on crates.io, use the following. If you are starting, we recommend using the `master` version at this point, as there have been significant API changes since v0.9.3.
61+
4762
```toml
4863
[dependencies]
4964
gdnative = "0.9.3"
@@ -52,13 +67,15 @@ gdnative = "0.9.3"
5267
crate-type = ["cdylib"]
5368
```
5469

55-
### Other versions or custom builds
70+
### Custom builds
71+
72+
To use the bindings with a non-default Godot version or a custom build, see [Using custom builds of Godot](https://godot-rust.github.io/book/advanced-guides/custom-godot.html) in the user guide.
5673

57-
The bindings are currently generated from the API description of Godot 3.2.3-stable by default. To use the bindings with another version or a custom build, see [Using custom builds of Godot](https://godot-rust.github.io/book/advanced-guides/custom-bindings.html) in the user guide.
74+
In short, you will need to generate `api.json` manually, using `godot --gdnative-generate-json-api api.json` to replace the file in the `gdnative-bindings` directory.
5875

59-
### Async / "`yield`" support
76+
### Async / `yield` support
6077

61-
Async support is a work-in-progress, with a low-level API available in the `gdnative-async` crate. This crate is re-exported as `gdnative::tasks`, if the `async` feature is enabled on `gdnative`.
78+
Async support is a work-in-progress, with a low-level API available in the `gdnative-async` crate. This crate is re-exported as `gdnative::tasks`, if the `async` feature is enabled on `gdnative`. See [this page](https://godot-rust.github.io/book/recipes/async-tokio.html) in the book for an introduction to use the async feature with Tokio.
6279

6380
## Example
6481

@@ -107,15 +124,20 @@ godot_init!(init);
107124
108125
The [/examples](https://github.com/godot-rust/godot-rust/tree/master/examples) directory contains several ready to use examples, complete with Godot projects and setup for easy compilation from Cargo:
109126

110-
- [/examples/hello_world](https://github.com/godot-rust/godot-rust/tree/master/examples/hello_world) - Your first project, writes to the console
111-
- [/examples/spinning_cube/](https://github.com/godot-rust/godot-rust/tree/master/examples/spinning_cube) - Spinning our own node in place, exposing editor properties.
112-
- [/examples/scene_create](https://github.com/godot-rust/godot-rust/tree/master/examples/scene_create) - Shows you how to load, instance and place scenes using Rust code
113-
- [/examples/signals](https://github.com/godot-rust/godot-rust/tree/master/examples/signals) - Shows you how to handle signals.
114-
- [/examples/resource](https://github.com/godot-rust/godot-rust/tree/master/examples/resource) - Shows you how to create and use custom resources.
115-
- [/examples/native_plugin](https://github.com/godot-rust/godot-rust/tree/master/examples/native_plugin) - Shows you how to create custom node plugins.
127+
- [**hello_world**](https://github.com/godot-rust/godot-rust/tree/master/examples/hello_world) - Your first project, writes to the console.
128+
- [**spinning_cube**](https://github.com/godot-rust/godot-rust/tree/master/examples/spinning_cube) - Spin our own node in place, exposing editor properties.
129+
- [**scene_create**](https://github.com/godot-rust/godot-rust/tree/master/examples/scene_create) - Load, instance and place scenes using Rust code.
130+
- [**array_export**](https://github.com/godot-rust/godot-rust/tree/master/examples/array_export) - Export more complex properties (here arrays) from Rust.
131+
- [**dodge_the_creeps**](https://github.com/godot-rust/godot-rust/tree/master/examples/dodge_the_creeps) - A Rust port of the [little Godot game](https://docs.godotengine.org/en/stable/getting_started/step_by_step/your_first_game.html).
132+
- [**signals**](https://github.com/godot-rust/godot-rust/tree/master/examples/signals) - Connect and emit signals.
133+
- [**resource**](https://github.com/godot-rust/godot-rust/tree/master/examples/resource) - Create and use custom resources.
134+
- [**rpc**](https://github.com/godot-rust/godot-rust/tree/master/examples/rpc) - Simple peer-to-peer networking.
135+
- [**native_plugin**](https://github.com/godot-rust/godot-rust/tree/master/examples/native_plugin) - Create custom node plugins.
116136

117137
## Third-party resources
118138

139+
See also (work-in-progress): [Third-party projects](https://godot-rust.github.io/book/projects.html) in the book.
140+
119141
### Tools and integrations
120142

121143
- [godot-egui](https://github.com/setzer22/godot-egui) (setzer22, jacobsky) - combine the [egui](https://github.com/emilk/egui) library with Godot
@@ -139,4 +161,4 @@ See the [contribution guidelines](CONTRIBUTING.md).
139161

140162
## License
141163

142-
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed under the [MIT license](LICENSE.md), without any additional terms or conditions.
164+
Any contribution intentionally submitted for inclusion in the work by you shall be licensed under the [MIT license](LICENSE.md), without any additional terms or conditions.

examples/dodge_the_creeps/src/player.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,17 @@ impl Player {
4747
let input = Input::godot_singleton();
4848
let mut velocity = Vector2::new(0.0, 0.0);
4949

50-
if Input::is_action_pressed(input, "ui_right") {
50+
// Note: exact=false by default, in Rust we have to provide it explicitly
51+
if Input::is_action_pressed(input, "ui_right", false) {
5152
velocity.x += 1.0
5253
}
53-
if Input::is_action_pressed(input, "ui_left") {
54+
if Input::is_action_pressed(input, "ui_left", false) {
5455
velocity.x -= 1.0
5556
}
56-
if Input::is_action_pressed(input, "ui_down") {
57+
if Input::is_action_pressed(input, "ui_down", false) {
5758
velocity.y += 1.0
5859
}
59-
if Input::is_action_pressed(input, "ui_up") {
60+
if Input::is_action_pressed(input, "ui_up", false) {
6061
velocity.y -= 1.0
6162
}
6263

0 commit comments

Comments
 (0)