### ExStart::done Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/skeleton_ik_3d/struct.ExStart.html?search=std%3A%3Avec Finalizes the IK setup and starts the IK process. ```APIDOC ## pub fn done(self) ### Description Finalizes the IK setup and starts the IK process. ### Parameters None. ``` -------------------------------- ### Getting Setup Status Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.SkeletonModification2DJiggle.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the setup status of the modification. ```rust pub fn get_is_setup(&self) -> bool ``` -------------------------------- ### Get Selection From Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/rich_text_label/struct.SignalsOfRichTextLabel.html?search=u32+-%3E+bool Gets the starting index of the current text selection. ```APIDOC ## pub fn get_selection_from(&self) -> i32 ### Description Returns the starting character index of the current text selection. ### Returns i32 - The starting index of the selection. ``` -------------------------------- ### ExStart::done Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/skeleton_ik_3d/struct.ExStart.html?search=u32+-%3E+bool Finalizes the IK start configuration. ```APIDOC ## pub fn done(self) ### Description Finalizes the IK start configuration. This method should be called after setting any desired parameters on the ExStart struct. ``` -------------------------------- ### Setup State Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.SkeletonModification2DPhysicalBones.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods to set and get the setup state of the modification. ```APIDOC ## Methods from Deref ### pub fn set_is_setup(&mut self, is_setup: bool) Sets whether the modification has been set up. ### pub fn get_is_setup(&self) -> bool Returns `true` if the modification has been set up, `false` otherwise. ``` -------------------------------- ### ExGetStart Methods Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/reg_ex_match/struct.ExGetStart.html?search= Exposes methods for configuring and finalizing the `RegExMatch::get_start_ex` operation. ```APIDOC ### impl<'ex> ExGetStart<'ex> #### pub fn name(self, name: &'ex Variant) -> ExGetStart<'ex> Sets a name parameter for the `get_start_ex` operation. #### pub fn done(self) -> i32 Finalizes the `get_start_ex` operation and returns the result. ``` -------------------------------- ### Rendering Server Information and Setup Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.RenderingServer.html Methods for retrieving rendering information, adapter details, and setting up boot images. ```APIDOC ## pub fn get_rendering_info(&self, info: RenderingInfo) -> u64 ### Description Retrieves specific rendering information based on the provided `RenderingInfo` enum. ### Method GET ### Endpoint `/rendering_server/get_rendering_info` ### Parameters #### Query Parameters - **info** (RenderingInfo) - Required - The type of rendering information to retrieve. ### Response #### Success Response (200) - **value** (u64) - The requested rendering information value. ## pub fn get_video_adapter_name(&self) -> GString ### Description Gets the name of the video adapter currently in use. ### Method GET ### Endpoint `/rendering_server/get_video_adapter_name` ### Response #### Success Response (200) - **name** (GString) - The name of the video adapter. ## pub fn get_video_adapter_vendor(&self) -> GString ### Description Gets the vendor of the video adapter currently in use. ### Method GET ### Endpoint `/rendering_server/get_video_adapter_vendor` ### Response #### Success Response (200) - **vendor** (GString) - The vendor of the video adapter. ## pub fn get_video_adapter_type(&self) -> DeviceType ### Description Gets the type of the video adapter. ### Method GET ### Endpoint `/rendering_server/get_video_adapter_type` ### Response #### Success Response (200) - **type** (DeviceType) - The type of the video adapter. ## pub fn get_video_adapter_api_version(&self) -> GString ### Description Gets the API version of the video adapter. ### Method GET ### Endpoint `/rendering_server/get_video_adapter_api_version` ### Response #### Success Response (200) - **version** (GString) - The API version of the video adapter. ## pub fn get_current_rendering_driver_name(&self) -> GString ### Description Gets the name of the current rendering driver. ### Method GET ### Endpoint `/rendering_server/get_current_rendering_driver_name` ### Response #### Success Response (200) - **name** (GString) - The name of the rendering driver. ## pub fn get_current_rendering_method(&self) -> GString ### Description Gets the current rendering method being used. ### Method GET ### Endpoint `/rendering_server/get_current_rendering_method` ### Response #### Success Response (200) - **method** (GString) - The current rendering method. ## pub fn set_boot_image_with_stretch( &mut self, image: impl AsArg>>, color: Color, stretch_mode: SplashStretchMode, ) ### Description Sets the boot image with a specified stretch mode. For default parameters, use `set_boot_image_with_stretch_ex`. ### Method POST ### Endpoint `/rendering_server/set_boot_image_with_stretch` ### Parameters #### Request Body - **image** (Option>) - The boot image to set. - **color** (Color) - The background color for the boot image. - **stretch_mode** (SplashStretchMode) - The stretch mode for the image. ## pub fn set_boot_image_with_stretch_ex<'ex>( &'ex mut self, image: impl AsArg>> + 'ex, color: Color, stretch_mode: SplashStretchMode, ) -> ExSetBootImageWithStretch<'ex> ### Description Sets the boot image with a specified stretch mode, returning a builder for further configuration. ### Method POST ### Endpoint `/rendering_server/set_boot_image_with_stretch_ex` ### Parameters #### Request Body - **image** (Option>) - The boot image to set. - **color** (Color) - The background color for the boot image. - **stretch_mode** (SplashStretchMode) - The stretch mode for the image. ### Response #### Success Response (200) - **builder** (ExSetBootImageWithStretch) - A builder object for further configuration. ## pub fn set_boot_image( &mut self, image: impl AsArg>>, color: Color, scale: bool, ) ### Description Sets the boot image with a specified scale option. For default parameters, use `set_boot_image_ex`. ### Method POST ### Endpoint `/rendering_server/set_boot_image` ### Parameters #### Request Body - **image** (Option>) - The boot image to set. - **color** (Color) - The background color for the boot image. - **scale** (bool) - Whether to scale the image. ## pub fn set_boot_image_ex<'ex>( &'ex mut self, image: impl AsArg>> + 'ex, color: Color, scale: bool, ) -> ExSetBootImage<'ex> ### Description Sets the boot image with a specified scale option, returning a builder for further configuration. ### Method POST ### Endpoint `/rendering_server/set_boot_image_ex` ### Parameters #### Request Body - **image** (Option>) - The boot image to set. - **color** (Color) - The background color for the boot image. - **scale** (bool) - Whether to scale the image. ### Response #### Success Response (200) - **builder** (ExSetBootImage) - A builder object for further configuration. ## pub fn get_default_clear_color(&self) -> Color ### Description Gets the default clear color used for the rendering buffer. ### Method GET ### Endpoint `/rendering_server/get_default_clear_color` ### Response #### Success Response (200) - **color** (Color) - The default clear color. ## pub fn set_default_clear_color(&mut self, color: Color) ### Description Sets the default clear color for the rendering buffer. ### Method POST ### Endpoint `/rendering_server/set_default_clear_color` ### Parameters #### Request Body - **color** (Color) - The color to set as the default clear color. ## pub fn has_os_feature(&self, feature: impl AsArg) -> bool ### Description Checks if the operating system has a specific feature enabled. ### Method GET ### Endpoint `/rendering_server/has_os_feature` ### Parameters #### Query Parameters - **feature** (GString) - Required - The name of the OS feature to check. ### Response #### Success Response (200) - **has_feature** (bool) - True if the OS has the feature, false otherwise. ## pub fn set_debug_generate_wireframes(&mut self, generate: bool) ### Description Enables or disables the generation of wireframes for debugging purposes. ### Method POST ### Endpoint `/rendering_server/set_debug_generate_wireframes` ### Parameters #### Request Body - **generate** (bool) - Required - Whether to generate wireframes. ## pub fn is_render_loop_enabled(&self) -> bool ### Description Checks if the render loop is currently enabled. ### Method GET ### Endpoint `/rendering_server/is_render_loop_enabled` ### Response #### Success Response (200) - **enabled** (bool) - True if the render loop is enabled, false otherwise. ## pub fn set_render_loop_enabled(&mut self, enabled: bool) ### Description Enables or disables the render loop. ### Method POST ### Endpoint `/rendering_server/set_render_loop_enabled` ### Parameters #### Request Body - **enabled** (bool) - Required - Whether to enable the render loop. ## pub fn get_frame_setup_time_cpu(&self) -> f64 ### Description Gets the CPU time taken for frame setup. ### Method GET ### Endpoint `/rendering_server/get_frame_setup_time_cpu` ### Response #### Success Response (200) - **time** (f64) - The CPU time in seconds. ## pub fn force_sync(&mut self) ### Description Forces synchronization of the rendering thread. ### Method POST ### Endpoint `/rendering_server/force_sync` ## pub fn force_draw(&mut self) ### Description Forces the rendering engine to draw the current frame. For default parameters, use `force_draw_ex`. ### Method POST ### Endpoint `/rendering_server/force_draw` ## pub fn force_draw_ex<'ex>(&'ex mut self) -> ExForceDraw<'ex> ### Description Forces the rendering engine to draw the current frame, returning a builder for further configuration. ### Method POST ### Endpoint `/rendering_server/force_draw_ex` ### Response #### Success Response (200) - **builder** (ExForceDraw) - A builder object for further configuration. ## pub fn get_rendering_device(&self) -> Option> ### Description Gets the current rendering device. ### Method GET ### Endpoint `/rendering_server/get_rendering_device` ### Response #### Success Response (200) - **device** (Option>) - The rendering device, or None if not available. ## pub fn create_local_rendering_device(&self) -> Option> ### Description Creates a local rendering device. ### Method POST ### Endpoint `/rendering_server/create_local_rendering_device` ### Response #### Success Response (200) - **device** (Option>) - The created rendering device, or None if creation failed. ## pub fn is_on_render_thread(&self) -> bool ### Description Checks if the current thread is the rendering thread. ### Method GET ### Endpoint `/rendering_server/is_on_render_thread` ### Response #### Success Response (200) - **is_render_thread** (bool) - True if the current thread is the render thread, false otherwise. ## pub fn call_on_render_thread(&mut self, callable: &Callable) ### Description Executes a callable on the rendering thread. ### Method POST ### Endpoint `/rendering_server/call_on_render_thread` ### Parameters #### Request Body - **callable** (Callable) - Required - The callable to execute on the render thread. ## pub fn has_feature(&self, feature: Features) -> bool ### Description Checks if the rendering server supports a specific feature. ### Method GET ### Endpoint `/rendering_server/has_feature` ### Parameters #### Query Parameters - **feature** (Features) - Required - The rendering feature to check for. ### Response #### Success Response (200) - **has_feature** (bool) - True if the feature is supported, false otherwise. ``` -------------------------------- ### Get Start Position Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.NavigationPathQueryParameters2D.html?search= Returns the starting position of the path query. ```APIDOC #### pub fn get_start_position(&self) -> Vector2 ``` -------------------------------- ### ExGetStart Methods Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/reg_ex_match/struct.ExGetStart.html ExGetStart provides methods to configure and retrieve regular expression match start information. ```APIDOC ## ExGetStart Default-param extender for `RegExMatch::get_start_ex`. ### Methods #### `name(self, name: &'ex Variant) -> ExGetStart<'ex>` Sets a name for the match. This method is chainable. #### `done(self) -> i32` Finalizes the configuration and returns the start index of the match. ``` -------------------------------- ### Generate random integers using randi Source: https://godot-rust.github.io/docs/gdext/master/godot/global/fn.randi.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Use the modulo operator with randi() to get random integers within a specified range. For example, randi() % N returns a value between 0 and N-1. Adding 1 shifts the range to start from 1. ```gdscript randi() # Returns random integer between 0 and 2^32 - 1 randi() % 20 # Returns random integer between 0 and 19 randi() % 100 # Returns random integer between 0 and 99 randi() % 100 + 1 # Returns random integer between 1 and 100 ``` -------------------------------- ### start Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.AudioStreamPlaybackResampled.html?search= Starts the audio playback. Use `start_ex` for default parameters. ```APIDOC ### pub fn start(&mut self) Starts the audio playback. To set the default parameters, use `Self::start_ex` and its builder methods. See the book for detailed usage instructions. ``` -------------------------------- ### Get Pre-process Time Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.CpuParticles2D.html?search= Gets the time in seconds before the particle system starts emitting. ```APIDOC ## pub fn get_pre_process_time(&self) -> f64 Gets the time in seconds before the particle system starts emitting. ``` -------------------------------- ### start_ex Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.AudioStreamPlaybackResampled.html Provides an extended way to start audio playback with builder methods. ```APIDOC ### pub fn start_ex<'ex>(&'ex mut self) -> ExStart<'ex> Provides an extended way to start audio playback with builder methods. See the book for detailed usage instructions. ``` -------------------------------- ### Get Start Position Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.NavigationPathQueryParameters3D.html?search= Returns the current start position configured for the path query. ```rust pub fn get_start_position(&self) -> Vector3 ``` -------------------------------- ### Setting and Getting Start Position Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.NavigationPathQueryParameters2D.html Set and retrieve the starting position for the path query. ```APIDOC /// Sets the starting position for the path query. /// /// # Arguments /// /// * `start_position` - The starting `Vector2` position. /// /// # Examples /// /// ```rust /// use godot::classes::NavigationPathQueryParameters2D; /// use godot::core::Vector2; /// /// let mut params = NavigationPathQueryParameters2D::new_gd(); /// params.set_start_position(Vector2::new(10.0, 20.0)); /// ``` pub fn set_start_position(&mut self, start_position: Vector2); /// Returns the current starting position. /// /// # Examples /// /// ```rust /// use godot::classes::NavigationPathQueryParameters2D; /// use godot::core::Vector2; /// /// let mut params = NavigationPathQueryParameters2D::new_gd(); /// params.set_start_position(Vector2::new(10.0, 20.0)); /// let start_pos = params.get_start_position(); /// assert_eq!(start_pos, Vector2::new(10.0, 20.0)); /// ``` pub fn get_start_position(&self) -> Vector2; ``` -------------------------------- ### ExStart Methods Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/skeleton_ik_3d/struct.ExStart.html ExStart provides methods to configure one-time IK or mark the IK process as done. ```APIDOC ## ExStart Default-param extender for `SkeletonIk3d::start_ex`. ### Methods #### `one_time(self, one_time: bool) -> ExStart<'ex>` Configures the IK to run only once. #### `done(self)` Marks the IK process as completed. ``` -------------------------------- ### Get NavigationLink3D Start Position Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.NavigationLink3D.html Retrieves the local starting position of the navigation link. ```rust let start_pos = navigation_link.get_start_position(); ``` -------------------------------- ### Initialization Example Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.MobileVrInterface.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Example of how to find and initialize the 'Native mobile' interface in Godot. ```APIDOC ## Initialization Example ```gdscript var interface = XRServer.find_interface("Native mobile") if interface and interface.initialize(): get_viewport().use_xr = true ``` ``` -------------------------------- ### Example - user-defined init Source: https://godot-rust.github.io/docs/gdext/master/godot/obj/struct.OnReady.html?search= Demonstrates how to use OnReady with a user-defined initialization closure and manual initialization. ```APIDOC ## §Example - user-defined `init` ```rust use godot::prelude::*; #[derive(GodotClass)] #[class(base = Node)] struct MyClass { base: Base, auto: OnReady, manual: OnReady, } #[godot_api] impl INode for MyClass { fn init(base: Base) -> Self { Self { base, auto: OnReady::new(|| 11), manual: OnReady::manual(), } } fn ready(&mut self) { // self.auto is now ready with value 11. assert_eq!(*self.auto, 11); // self.manual needs to be initialized manually. self.manual.init(22); assert_eq!(*self.manual, 22); } } ``` ``` -------------------------------- ### Get MenuBar start index Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.MenuBar.html Returns the current starting index for menu items. ```rust pub fn get_start_index(&self) -> i32 ``` -------------------------------- ### ExPhysicalBonesStartSimulation::done Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/physical_bone_simulator_3d/struct.ExPhysicalBonesStartSimulation.html?search=u32+-%3E+bool Finalizes the simulation setup and returns the result. ```APIDOC ## ExPhysicalBonesStartSimulation::done ### Description Finalizes the simulation setup and returns the result. ### Method `done(self)` ``` -------------------------------- ### Get Next Selected Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.Tree.html?search=std%3A%3Avec Gets the next selected item in the tree, starting from a given item. ```APIDOC ## pub fn get_next_selected( &self, from: impl AsArg>>, ) -> Option> Gets the next selected item in the tree, starting from a given item. ``` -------------------------------- ### setup Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.OpenXrInteractionProfileEditor.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Sets up the OpenXrInteractionProfileEditor with an action map and an interaction profile. ```APIDOC ## Methods from Deref #### pub fn setup( &mut self, action_map: impl AsArg>>, interaction_profile: impl AsArg>>, ) ``` -------------------------------- ### Get Frame Setup Time CPU Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.RenderingServer.html?search= Retrieves the CPU time taken for frame setup. ```APIDOC ## get_frame_setup_time_cpu ### Description Gets the CPU time spent on setting up the current frame. ### Method `get_frame_setup_time_cpu() -> f64` ### Returns The CPU time in seconds. ``` -------------------------------- ### Get Match Start Index Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.RegExMatch.html Returns the starting index of the match within the subject string. ```rust pub fn get_start(&self) -> i32 ``` -------------------------------- ### start_ex Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/animation_node_state_machine_playback/struct.SignalsOfAnimationNodeStateMachinePlayback.html?search=std%3A%3Avec Provides an extended way to start playback of a node, allowing for default parameter configuration via builder methods. ```APIDOC ## start_ex ### Description Provides an extended way to start playback of a node, allowing for default parameter configuration via builder methods. ### Method `start_ex<'ex>(&'ex mut self, node: impl AsArg + 'ex) -> ExStart<'ex>` ``` -------------------------------- ### setup Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.OpenXrBindingModifierEditor.html?search=std%3A%3Avec Sets up the editor with the provided action map and binding modifier. ```APIDOC ## setup ```rust pub fn setup( &mut self, action_map: impl AsArg>>, binding_modifier: impl AsArg>>, ) ``` Sets up the editor with the provided action map and binding modifier. ``` -------------------------------- ### Get NavigationLink3D Global Start Position Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.NavigationLink3D.html Retrieves the global starting position of the navigation link. ```rust let global_start_pos = navigation_link.get_global_start_position(); ``` -------------------------------- ### start Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/animation_node_state_machine_playback/struct.SignalsOfAnimationNodeStateMachinePlayback.html?search=std%3A%3Avec Starts playback of a specific node within the state machine. For setting default parameters, `start_ex` with its builder methods is recommended. ```APIDOC ## start ### Description Starts playback of a specific node within the state machine. For setting default parameters, `start_ex` with its builder methods is recommended. ### Method `start(node: impl AsArg)` ``` -------------------------------- ### Getting selection start column Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.LineEdit.html?search=u32+-%3E+bool Returns the starting column index of the current text selection. ```rust pub fn get_selection_from_column(&self) -> i32 ``` -------------------------------- ### setup Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/open_xr_binding_modifier_editor/struct.SignalsOfOpenXrBindingModifierEditor.html?search=u32+-%3E+bool Sets up the binding modifier editor with an action map and a binding modifier. ```APIDOC ## setup ### Description Sets up the binding modifier editor with an action map and a binding modifier. ### Parameters - `action_map`: An `impl AsArg>>` representing the action map. - `binding_modifier`: An `impl AsArg>>` representing the binding modifier. ``` -------------------------------- ### Getting Selection Start Column Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.LineEdit.html?search= Returns the starting column index of the current text selection. ```rust self.get_selection_from_column() ``` -------------------------------- ### Example - macro-generated init Source: https://godot-rust.github.io/docs/gdext/master/godot/obj/struct.OnReady.html?search= Illustrates using OnReady with the #[init] attribute for automatic and manual initialization. ```APIDOC ## §Example - macro-generated `init` ```rust use godot::prelude::*; #[derive(GodotClass)] #[class(init, base = Node)] struct MyClass { base: Base, #[init(node = "ChildPath")] auto: OnReady>, #[init(val = OnReady::manual())] manual: OnReady, } #[godot_api] impl INode for MyClass { fn ready(&mut self) { // self.node is now ready with the node found at path `ChildPath`. assert_eq!(self.auto.get_name(), "ChildPath"); // self.manual needs to be initialized manually. self.manual.init(22); assert_eq!(*self.manual, 22); } } ``` ``` -------------------------------- ### Get Viewport Texture Example Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/viewport/struct.SignalsOfViewport.html?search=u32+-%3E+bool This example demonstrates how to get the viewport's texture and save it as a PNG file. It includes a note about potential issues with outdated textures and suggests awaiting the `RenderingServer.frame_post_draw` signal for accurate results. ```APIDOC ## Get Viewport Texture ### Description Returns the viewport’s texture. Note: When trying to store the current texture (e.g. in a file), it might be completely black or outdated if used too early, especially when used in e.g. `ready`. To make sure the texture you get is correct, you can await `RenderingServer.frame_post_draw` signal. ### Example (GDScript) ```gdscript func _ready(): await RenderingServer.frame_post_draw $Viewport.get_texture().get_image().save_png("user://Screenshot.png") ``` ### Example (C#) ```csharp public async override void _Ready() { await ToSignal(RenderingServer.Singleton, RenderingServer.SignalName.FramePostDraw); var viewport = GetNode("Viewport"); viewport.GetTexture().GetImage().SavePng("user://Screenshot.png"); } ``` ### Note When `use_hdr_2d` is `true` the returned texture will be an HDR image using linear encoding. ``` -------------------------------- ### UPnP Setup with Threading Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.Upnp.html Example of performing UPnP setup in a separate thread to avoid blocking the main thread. ```APIDOC ```gdscript # Emitted when UPnP port mapping setup is completed (regardless of success or failure). signal upnp_completed(error) # Replace this with your own server port number between 1024 and 65535. const SERVER_PORT = 3928 var thread = null func _upnp_setup(server_port): # UPNP queries take some time. var upnp = UPNP.new() var err = upnp.discover() if err != OK: push_error(str(err)) upnp_completed.emit(err) return if upnp.get_gateway() and upnp.get_gateway().is_valid_gateway(): upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "UDP") upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "TCP") upnp_completed.emit(OK) func _ready(): thread = Thread.new() thread.start(_upnp_setup.bind(SERVER_PORT)) func _exit_tree(): # Wait for thread finish here to handle game exit while the thread is running. thread.wait_to_finish() ``` ``` -------------------------------- ### Create and Save ConfigFile (C#) Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.ConfigFile.html?search=u32+-%3E+bool Illustrates the equivalent of the GDScript example in C#, showing how to instantiate ConfigFile, populate it with data, and persist it to disk. This is useful for C# projects needing configuration management. ```csharp // Create new ConfigFile object. var config = new ConfigFile(); // Store some values. config.SetValue("Player1", "player_name", "Steve"); config.SetValue("Player1", "best_score", 10); config.SetValue("Player2", "player_name", "V3geta"); config.SetVAlue("Player2", "best_score", 9001); // Save it to a file (overwrite if already exists). config.Save("user://scores.cfg"); ``` -------------------------------- ### ExStart Struct Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/audio_stream_playback/struct.ExStart.html Represents a default-param extender for AudioStreamPlayback::start_ex. ```APIDOC ## Struct ExStart ```rust pub struct ExStart<'ex> { /* private fields */ } ``` Default-param extender for `AudioStreamPlayback::start_ex`. ``` -------------------------------- ### get_begin Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/graph_edit/struct.SignalsOfGraphEdit.html?search= Gets the starting position of the GraphEdit. ```APIDOC ## pub fn get_begin(&self) -> Vector2 ### Description Gets the starting position of the GraphEdit. ### Returns The starting position as a Vector2. ``` -------------------------------- ### get_begin Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/container/struct.SignalsOfContainer.html?search= Gets the starting position of the control. ```APIDOC ## get_begin Gets the starting position of the control. ### Signature ```rust pub fn get_begin(&self) -> Vector2 ``` ``` -------------------------------- ### Example Searches Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.Shortcut.html?search= Demonstrates various ways to search for shortcuts. ```APIDOC ## Example Searches This section provides examples of how to search for shortcuts. You can search by: * **Module Name**: `std::vec` * **Type Conversion**: `u32 -> bool` * **Generic Type Transformations**: `Option, (T -> U) -> Option` ``` -------------------------------- ### Instantiate and Use PckPacker (GDScript) Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.PckPacker.html?search=u32+-%3E+bool Example of creating a new PckPacker instance, starting a PCK file, adding a file to it, and flushing the changes in GDScript. ```gdscript var packer = PCKPacker.new() packer.pck_start("test.pck") packer.add_file("res://text.txt", "text.txt") packer.flush() ``` -------------------------------- ### AnimationNodeTimeSeek Usage Example Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.AnimationNodeTimeSeek.html?search=std%3A%3Avec Examples demonstrating how to use AnimationNodeTimeSeek to control animation playback, such as playing from the start or a specific timestamp. ```APIDOC ## Godot docs This animation node can be used to cause a seek command to happen to any sub-children of the animation graph. Use to play an Animation from the start or a certain playback position inside the AnimationNodeBlendTree. After setting the time and changing the animation playback, the time seek node automatically goes into sleep mode on the next process frame by setting its `seek_request` value to `-1.0`. ```rust # Play child animation from the start. animation_tree.set("parameters/TimeSeek/seek_request", 0.0) # Alternative syntax (same result as above). animation_tree["parameters/TimeSeek/seek_request"] = 0.0 # Play child animation from 12 second timestamp. animation_tree.set("parameters/TimeSeek/seek_request", 12.0) # Alternative syntax (same result as above). animation_tree["parameters/TimeSeek/seek_request"] = 12.0 ``` ```csharp // Play child animation from the start. animationTree.Set("parameters/TimeSeek/seek_request", 0.0); // Play child animation from 12 second timestamp. animationTree.Set("parameters/TimeSeek/seek_request", 12.0); ``` ``` -------------------------------- ### Get Previous Composite Character Column Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/text_edit/struct.SignalsOfTextEdit.html?search=u32+-%3E+bool Gets the column of the previous composite character starting from the given line and column. ```APIDOC ## pub fn get_previous_composite_character_column(&self, line: i32, column: i32) -> i32 ### Description Gets the column of the previous composite character starting from the given line and column. ### Parameters - `line` (i32) - The starting line. - `column` (i32) - The starting column. ### Returns The column of the previous composite character. ``` -------------------------------- ### ExPhysicalBonesStartSimulation Methods Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/physical_bone_simulator_3d/struct.ExPhysicalBonesStartSimulation.html This snippet details the methods available on the ExPhysicalBonesStartSimulation struct for configuring bone simulation startup. ```APIDOC ## ExPhysicalBonesStartSimulation Default-param extender for `PhysicalBoneSimulator3D::physical_bones_start_simulation_ex`. ### Methods #### `bones(self, bones: &'ex Array) -> ExPhysicalBonesStartSimulation<'ex>` Sets the bones to be simulated. #### `done(self)` Finalizes the configuration and starts the simulation. ``` -------------------------------- ### Initialization Example Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.MobileVrInterface.html?search=u32+-%3E+bool Example of how to initialize the MobileVrInterface in GDScript. ```APIDOC ```gdscript var interface = XRServer.find_interface("Native mobile") if interface and interface.initialize(): get_viewport().use_xr = true ``` ``` -------------------------------- ### Get Next Composite Character Column Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/text_edit/struct.SignalsOfTextEdit.html?search=u32+-%3E+bool Gets the column of the next composite character starting from the given line and column. ```APIDOC ## pub fn get_next_composite_character_column(&self, line: i32, column: i32) -> i32 ### Description Gets the column of the next composite character starting from the given line and column. ### Parameters - `line` (i32) - The starting line. - `column` (i32) - The starting column. ### Returns The column of the next composite character. ``` -------------------------------- ### ExPckStart Methods Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/pck_packer/struct.ExPckStart.html This section details the methods available on the ExPckStart struct, which allow for configuring PCK packing parameters. ```APIDOC ## impl<'ex> ExPckStart<'ex> ### pub fn alignment(self, alignment: i32) -> ExPckStart<'ex> Sets the alignment for the PCK file. ### pub fn key(self, key: impl AsArg + 'ex) -> ExPckStart<'ex> Sets the encryption key for the PCK file. ### pub fn encrypt_directory(self, encrypt_directory: bool) -> ExPckStart<'ex> Enables or disables directory encryption for the PCK file. ### pub fn done(self) -> Error Finalizes the PCK packing process and returns an Error code. ``` -------------------------------- ### Get SpotLight3D Distance Fade Shadow Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.SpotLight3D.html?search=u32+-%3E+bool Gets the distance at which shadows from the SpotLight3D start to fade. This method is inherited from Light3D. ```rust pub fn get_distance_fade_shadow(&self) -> f32 ``` -------------------------------- ### Set and Get Range Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.CharFxTransform.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Methods to set and get the integer range (e.g., start and end indices) for character effects. ```rust pub fn get_range(&self) -> Vector2i ``` ```rust pub fn set_range(&mut self, range: Vector2i) ``` -------------------------------- ### ExGetStart::done Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/reg_ex_match/struct.ExGetStart.html?search=std%3A%3Avec Finalizes the configuration and returns the result of the RegExMatch::get_start_ex operation. ```APIDOC ## ExGetStart::done ### Description Finalizes the configuration and returns the result. ### Method `done` ### Returns - `i32`: The result of the `RegExMatch::get_start_ex` operation. ``` -------------------------------- ### get_from Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.PhysicsRayQueryParameters2D.html Gets the starting point of the ray query. ```APIDOC ## get_from ```rust pub fn get_from(&self) -> Vector2 ``` ``` -------------------------------- ### Godot Docs Example Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.TextServerDummy.html Example of how to access and use the dummy text server in Godot. ```APIDOC ## Godot docs A dummy TextServer interface that doesn’t do anything. Useful for freeing up memory when rendering text is not needed, as text servers are resource-intensive. It can also be used for performance comparisons in complex GUIs to check the impact of text rendering. A dummy text server is always available at the start of a project. Here’s how to access it: ```gdscript var dummy_text_server = TextServerManager.find_interface("Dummy") if dummy_text_server != null: TextServerManager.set_primary_interface(dummy_text_server) # If the other text servers are unneeded, they can be removed: for i in TextServerManager.get_interface_count(): var text_server = TextServerManager.get_interface(i) if text_server != dummy_text_server: TextServerManager.remove_interface(text_server) ``` The command line argument `--text-driver Dummy` (case-sensitive) can be used to force the “Dummy” TextServer on any project. ``` -------------------------------- ### setup Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.OpenXrInteractionProfileEditor.html Sets up the interaction profile editor with the given action map and interaction profile. ```APIDOC ## Methods from Deref #### pub fn setup( &mut self, action_map: impl AsArg>>, interaction_profile: impl AsArg>>, ) ``` -------------------------------- ### get_begin Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.EditorScriptPicker.html Gets the starting position of a range or path. ```APIDOC ## pub fn get_begin(&self) -> Vector2 ### Description Gets the starting position. ### Returns A `Vector2` representing the starting position. ``` -------------------------------- ### get_drag_data Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/trait.IMarginContainer.html?search=std%3A%3Avec Gets the data that should be dragged when a drag operation starts. ```APIDOC ## fn get_drag_data(&mut self, at_position: Vector2) -> Variant ### Parameters - `at_position` (Vector2) - The position where the drag operation starts. ### Return Value - `Variant` - The data to be dragged. ``` -------------------------------- ### ExPckStart Configuration Methods Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/pck_packer/struct.ExPckStart.html?search= These methods allow you to configure various aspects of the PCK packing process, such as alignment, encryption, and the encryption key. Each method returns a modified ExPckStart instance, enabling method chaining. ```APIDOC ## ExPckStart Default-param extender for `PckPacker::pck_start_ex`. ### Methods #### `alignment(self, alignment: i32) -> ExPckStart<'ex>` Sets the alignment for the PCK file. #### `key(self, key: impl AsArg + 'ex) -> ExPckStart<'ex>` Sets the encryption key for the PCK file. #### `encrypt_directory(self, encrypt_directory: bool) -> ExPckStart<'ex>` Enables or disables directory encryption for the PCK file. #### `done(self) -> Error` Finalizes the configuration and returns an `Error` status. This method should be called after all desired configurations have been applied. ``` -------------------------------- ### shaped_text_prev_grapheme_pos Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.TextServerAdvanced.html Gets the starting position of the previous grapheme cluster. ```APIDOC ## shaped_text_prev_grapheme_pos ### Description Gets the starting position of the previous grapheme cluster. ### Method `shaped_text_prev_grapheme_pos(shaped: Rid, pos: i64) -> i64` ### Parameters * `shaped` (Rid) - The RID of the shaped text. * `pos` (i64) - The current grapheme cluster position. ### Returns The starting position of the previous grapheme cluster. ``` -------------------------------- ### Instantiate and Use PckPacker (C#) Source: https://godot-rust.github.io/docs/gdext/master/godot/classes/struct.PckPacker.html?search=u32+-%3E+bool Example of creating a new PckPacker instance, starting a PCK file, adding a file to it, and flushing the changes in C#. ```csharp var packer = new PckPacker(); packer.PckStart("test.pck"); packer.AddFile("res://text.txt", "text.txt"); packer.Flush(); ```