|
1 |
| -//! Functionality for user-defined types exported to the engine (native scripts) |
| 1 | +//! Functionality for user-defined types exported to the engine (native scripts). |
2 | 2 | //!
|
3 | 3 | //! NativeScript allows users to have their own scripts in a native language (in this case Rust).
|
4 | 4 | //! It is _not_ the same as GDNative, the native interface to call into Godot.
|
|
8 | 8 | //! If you are looking for how to manage Godot core types or classes (objects), check
|
9 | 9 | //! out the [`core_types`][crate::core_types] and [`object`][crate::object] modules, respectively.
|
10 | 10 | //!
|
11 |
| -//! ## Init and exit hooks |
12 |
| -//! |
13 |
| -//! Three endpoints are automatically invoked by the engine during startup and shutdown: |
14 |
| -//! |
15 |
| -//! * [`godot_gdnative_init`], |
16 |
| -//! * [`godot_nativescript_init`], |
17 |
| -//! * [`godot_gdnative_terminate`], |
18 |
| -//! |
19 |
| -//! All three must be present. To quickly define all three endpoints using the default names, |
20 |
| -//! use [`godot_init`]. |
21 |
| -//! |
22 |
| -//! ## Registering script classes |
23 |
| -//! |
24 |
| -//! [`InitHandle`] is the registry of all your exported symbols. |
25 |
| -//! To register script classes, call [`InitHandle::add_class()`] or [`InitHandle::add_tool_class()`] |
26 |
| -//! in your [`godot_nativescript_init`] or [`godot_init`] callback: |
27 |
| -//! |
28 |
| -//! ```ignore |
29 |
| -//! use gdnative::prelude::*; |
30 |
| -//! |
31 |
| -//! fn init(handle: InitHandle) { |
32 |
| -//! handle.add_class::<HelloWorld>(); |
33 |
| -//! } |
34 |
| -//! |
35 |
| -//! godot_init!(init); |
36 |
| -//! ``` |
| 11 | +//! To handle initialization and shutdown of godot-rust, take a look at the [`init`][crate::init] module. |
37 | 12 | //!
|
38 | 13 | //! For full examples, see [`examples`](https://github.com/godot-rust/godot-rust/tree/master/examples)
|
39 | 14 | //! in the godot-rust repository.
|
|
0 commit comments