-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tracker] The godot-rust Book #1
Comments
Very interested to the
It doesn't need to be something too complicated or too simple but once there, the reader may understand when he wants a Button for example, he can get some API documentation on docs.godotengine.org and translate his knowledge into the doc.rs one, while also knowing he can use some methods and properties in BaseButton, Control, CanvasItem, etc. because Button inherits from X.
At this point, the reader should be able to understand what is going on here. Assuming yes, we can start talking about exporting (and the purpose of |
@tommywalkie I agree that a quick refresher of Godot's Scene/Node architecture can be useful here for convenience. Added to the topic list! Also clarified a bit about the tutorial: it should include instructions for installing dependencies, of course. MSVC vs GNU for Windows is also a good point that I missed. Thanks for the suggestions! |
Hi, |
Hi @steelx! Thanks for asking! This documentation effort is, first and foremost, focused on the usage of this binding library. For the limited contributor time available to us, this means that we cannot afford to spare long chapters on complex game mechanic, which is not really related to this library. In short, while the book will contain a guided tour, I don't think a "full game" tutorial would fit in our scope. As an aside, the GDNative bindings are orthogonal to how your game logic is implemented. It's completely possible to use a Rust ECS like Specs or Legion alongside Godot: I'm aware of several users that do this. You can still make use of the tutorial that you've linked! |
If you're looking for topics to cover - you've already mentioned |
Some recent issues are caused by users not using standalone |
On a side note, some recent studies in tommywalkie/sample-godot-rust-app#17 could lead to a possible successful iOS build/export. TL;DR : The catch here is I need to enroll into Apple Developer Program (99 USD/yr, it apparently has a free tier, but it still requires a registered Apple trusted device) to get a required Apple Team ID and be able to certify the setup. |
Is there a recommended method? Or is this also WIP in the code? |
@tommywalkie I don't think the article says you need a device to run apps on the emulator? Obviously you'll need to physically own an actual device to run build on it, though, and that device needs to be registered to your Apple Developer ID. I'm not sure if I can be of any help here, sadly. @Filius-Patris In the repo we have our tests in the |
@toasteater I left the article link mainly for the “free tier” subject through. |
Currently there's getting-started.md and introduction.md, as well as the getting-started subdir. What's the purpose of each of them? I just figured I might start writing instructions on how to set up Godot + rust, since I already managed to do it. |
@tommywalkie I see. Still, I don't really think I'm able to do anything here. I also don't have an Apple Developer subscription. Sorry. @Filius-Patris |
@milkvolleyball I don't think this will be adequate. GDScript and C# are primarily supported by Godot. GDNative integrations are community projects (iirc). Plus, the official Godot docs would need to detail any Python/Kotlin/D/Rust/C++/etc. requirements and build steps, this will become heavy. |
Perhaps a note in the docs about using the |
@halzy But there will be no enums after godot-rust/gdnative#424? |
@toasteater For people coming from the Godot docs. They may look for enums that don't exist. |
I see. Makes sense. |
As the book is in progress it could really use more explanation and examples around Ref/TRef and assume_safe and all it's variations. I'll give an example for clarification: I'm moving my 0.8 code over to 0.9, and as part of my code I had a struct that held an Optional sprite, that's been changed to fit:
When I create the sprite I give it a name and assign it a texture at random from the resources. Unfortunately the entire function is still unsafe. At this time I create a mutable shared ref, and assume it's safe. After setting the texture I add the child, and then after it's added I save a reference - making sure to
|
@paytonrules Acknowledged. If you need more information on As for the example code you have posted, you don't need to mark the entire function #[export]
fn _enter_tree(&mut self, owner: &Node2D) {
/* ... */
let sprite = Sprite::new();
let sprite_name = /* irrelevant */
let resource_loader = ResourceLoader::godot_singleton();
let texture = /* irrelevant */;
sprite.set_texture(texture);
let sprite = unsafe { sprite.into_shared().assume_safe() };
owner.add_child(sprite, false);
self.sprite = Some(sprite.claim());
} |
Thanks @toasteater - I knew I didn't need the function unsafe, I just wanted to post it up before I forgot. Is this still the best place for suggestions for the book? Or should there be new issues? |
@paytonrules It might be better to open new issues now that we have a separate repo! |
Over time, the godot-rust library grows, and the intricacies of the project can no longer fit in a simple README file. While there is the API documentation, it is very technical and hard to navigate for new users. The presence of multiple community-written "getting started" tutorials is evidence that the learning curve is problematic and we really need an expanded user guide.
Topics that should be covered
yield
,preload
, etc.) (#400)Instance
downcasting API (frequently asked question, example issues: Support (or document) downcasting Nodes to scripts gdnative#328, [discussion] Calling not-exported native function of one node from another node gdnative#273, and a lot more) (tracked in Frequently asked questions #5)Contributing to the book
Since the book is still a very early work-in-progress and mostly blank, please leave a comment here before going ahead to write a section, to avoid duplication of work. PRs for the book should be made against the
book
branch, instead ofmaster
.If there are other topics that you think should be covered in the book, please feel free to suggest them in the comments here.
Supersedes godot-rust/gdnative#209.
The text was updated successfully, but these errors were encountered: