Skip to content

Added Godot exportable methods along with the expected signature #781

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

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

jacobsky
Copy link
Contributor

@jacobsky jacobsky commented Sep 6, 2021

Added a list of the Godot Virtual methods from Node and Control to the #[export] trait documentation.

closes #672

@jacobsky jacobsky force-pushed the issue_672 branch 2 times, most recently from 2fcff8c to 477a5d3 Compare September 6, 2021 00:47
Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the exhaustive list and all the detailed links!

As usual, the structure is very good, the comments concern just some typos/nitpicks 🙂

jacobsky added a commit to jacobsky/godot-rust that referenced this pull request Sep 6, 2021
…o the Godot Docs in the #[export] trait documentation.

Also fixed up as per the requests in PR godot-rust#781

closes godot-rust#672
jacobsky added a commit to jacobsky/godot-rust that referenced this pull request Sep 6, 2021
…o the Godot Docs in the #[export] trait documentation.

Also fixed up as per the requests in PR godot-rust#781

closes godot-rust#672
@jacobsky
Copy link
Contributor Author

jacobsky commented Sep 6, 2021

@Bromeon I've gone ahead and fixed up everything that you asked for. Let me know if you think anything else is needed.

@Bromeon
Copy link
Member

Bromeon commented Sep 6, 2021

Instead of this:
grafik

I'd format them like this:
grafik

That makes it much clearer which parts belong together.

Here's the code, so you don't have to constantly micro-adjust things.
/// This is a list of common Godot virtual functions that are automatically called via [notifications](https://docs.godotengine.org/en/stable/classes/class_object.html#class-object-method-notification):
/// <br><br>
///
/// ```
/// fn _ready(&self, owner: &Node);
/// ```
/// Called when both the node and its children have entered the scene tree.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-ready) for more information._
/// <br><br>
///
/// ```
/// fn _enter_tree(&self, owner: &Node);
/// ```
/// Called when the node enters the scene tree.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-enter-tree) for more information._
/// <br><br>
///
/// ```
/// fn _exit_tree(&self, owner: &Node);
/// ```
/// Called when the node is removed from the scene tree.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-exit-tree) for more information._
/// <br><br>
///
/// ```
/// fn _get_configuration_warning(&self, owner: &Node);
/// ```
/// The string returned from this method is displayed as a warning in the Scene Dock if the script that overrides it is a tool script.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-get-configuration-warning) for more information._
/// <br><br>
///
/// ```
/// fn _process(&mut self, owner: &Node, delta: f64);
/// ```
/// Called during processing step of the main loop.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-process) for more information._
/// <br><br>
///
/// ```
/// fn _physics_process(&self, owner: &Node, delta: f64);
/// ```
/// Called during physics update, with a fixed timestamp.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-physics-process) for more information._
/// <br><br>
///
/// ```
/// fn _input(&self, owner: &Node, event: InputEvent);
/// ```
/// Called when there is an input event.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-input) for more information._
/// <br><br>
///
/// ```
/// fn _unhandled_input(&self, owner: &Node, event: InputEvent);
/// ```
/// Called when an `InputEvent` hasn't been consumed by `_input()` or any GUI.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-unhandled-input) for more information._
/// <br><br>
///
/// ```
/// fn _unhandled_key_input (&self, owner: &Node, event: InputKeyEvent);
/// ```
/// Called when an `InputEventKey` hasn't been consumed by `_input()` or any GUI.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-unhandled-key-input) for more information._
/// <br><br>
///
/// #### `Control` virtual functions
///
/// This is a list of common Godot virtual functions that are automatically called via [notifications](https://docs.godotengine.org/en/stable/classes/class_object.html#class-object-method-notification).
///
/// ```
/// fn _clips_input(&self, owner: &Control) -> bool;
/// ```
/// Returns whether `_gui_input()` should not be called for children controls outside this control's rectangle.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_control.html#class-control-method-clips-input) for more information._
/// <br><br>
///
/// ```
/// fn _get_minimum_size(&self, owner: &Control) -> Vector2;
/// ```
/// Returns the minimum size for this control.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_control.html#class-control-method-get-minimum-size) for more information._
/// <br><br>
///
/// ```
/// fn _gui_input(&self, owner: &Control, event: InputEvent);
/// ```
/// Use this method to process and accept inputs on UI elements.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_control.html#class-control-method-gui-input) for more information._
/// <br><br>
///
/// ```
/// fn _make_custom_tooltip(&self, owner: &Control, for_text: String) -> Ref<Control>;
/// ```
/// Returns a `Control` node that should be used as a tooltip instead of the default one.  
/// _See [Godot docs](https://docs.godotengine.org/en/stable/classes/class_control.html#class-control-method-make-custom-tooltip) for more information._
/// <br><br>

jacobsky added a commit to jacobsky/godot-rust that referenced this pull request Sep 7, 2021
…o the Godot Docs in the #[export] trait documentation.

Also fixed up as per the requests in PR godot-rust#781

closes godot-rust#672
@jacobsky
Copy link
Contributor Author

jacobsky commented Sep 7, 2021

@Bromeon Thank you very much, I've included the changes in my latest push.

@jacobsky
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Sep 13, 2021
@bors
Copy link
Contributor

bors bot commented Sep 13, 2021

try

Build failed:

jacobsky added a commit to jacobsky/godot-rust that referenced this pull request Sep 13, 2021
…o the Godot Docs in the #[export] trait documentation.

Also fixed up as per the requests in PR godot-rust#781
Fixed the doc test failures.
closes godot-rust#672
…o the Godot Docs in the #[export] trait documentation.

Also fixed up as per the requests in PR godot-rust#781
Fixed the doc test failures.
closes godot-rust#672
@jacobsky
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Sep 13, 2021
@bors
Copy link
Contributor

bors bot commented Sep 13, 2021

try

Build succeeded:

@Bromeon
Copy link
Member

Bromeon commented Sep 16, 2021

Let's try with the new workflow 🚀
bors try

bors bot added a commit that referenced this pull request Sep 16, 2021
@bors
Copy link
Contributor

bors bot commented Sep 16, 2021

try

Build succeeded:

@jacobsky
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 22, 2021

Build succeeded:

@bors bors bot merged commit 490ae0f into godot-rust:master Sep 22, 2021
Bromeon pushed a commit to Bromeon/godot-rust that referenced this pull request Sep 27, 2021
…o the Godot Docs in the #[export] trait documentation.

Also fixed up as per the requests in PR godot-rust#781
Fixed the doc test failures.
closes godot-rust#672
Bogay pushed a commit to Bogay/godot-rust that referenced this pull request Nov 17, 2021
…o the Godot Docs in the #[export] trait documentation.

Also fixed up as per the requests in PR godot-rust#781
Fixed the doc test failures.
closes godot-rust#672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List of methods that can be exported to Godot
2 participants