### Custom Touchpad Integration Example Source: https://docs.rs/bevy_archie/latest/bevy_archie/touchpad/fn.update_touchpad_data.html An example demonstrating how to integrate custom touchpad data into the Bevy application by manually setting finger data and updating the frame. ```APIDOC ## Example Custom Integration ```rust fn custom_touchpad_system(mut gamepads: Query<&mut TouchpadData>) { // Get raw touchpad data from your platform-specific source let (f1_x, f1_y, f1_pressed) = get_touchpad_finger1(); let (f2_x, f2_y, f2_pressed) = get_touchpad_finger2(); for mut touchpad in &mut gamepads { touchpad.set_finger(0, f1_x, f1_y, f1_pressed); touchpad.set_finger(1, f2_x, f2_y, f2_pressed); touchpad.update_frame(); } } ``` ``` -------------------------------- ### Start Input Playback Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.InputPlayback.html Initializes and starts the input playback process with a given set of recorded inputs and a start time. ```rust pub fn start(&mut self, inputs: Vec, time: f64) ``` -------------------------------- ### Custom Touchpad Integration Example Source: https://docs.rs/bevy_archie/latest/bevy_archie/touchpad/fn.update_touchpad_data.html This example demonstrates how to integrate custom touchpad data by accessing raw events from a platform-specific source and updating the `TouchpadData` component. Ensure you have functions like `get_touchpad_finger1()` and `get_touchpad_finger2()` defined elsewhere to retrieve the actual finger data. ```rust fn custom_touchpad_system(mut gamepads: Query<&mut TouchpadData>) { // Get raw touchpad data from your platform-specific source let (f1_x, f1_y, f1_pressed) = get_touchpad_finger1(); let (f2_x, f2_y, f2_pressed) = get_touchpad_finger2(); for mut touchpad in &mut gamepads { touchpad.set_finger(0, f1_x, f1_y, f1_pressed); touchpad.set_finger(1, f2_x, f2_y, f2_pressed); touchpad.update_frame(); } } ``` -------------------------------- ### Start Input Recording Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.InputRecorder.html Initializes the recording process for InputRecorder by setting the start time. ```rust pub fn start(&mut self, time: f64) ``` -------------------------------- ### PlaybackCommand Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.PlaybackCommand.html Represents a command to start playback, containing a vector of recorded inputs. ```APIDOC ## Struct PlaybackCommand ### Summary ``` pub struct PlaybackCommand { pub inputs: Vec, } ``` ### Description Command to start playback. ### Fields * `inputs: Vec` - Inputs to play back. ``` -------------------------------- ### Handling Touchpad Gestures Source: https://docs.rs/bevy_archie/latest/bevy_archie/touchpad/enum.TouchpadGesture.html Example of how to handle different touchpad gestures using a match statement. ```APIDOC fn handle_gesture(gesture: TouchpadGesture) { match gesture { TouchpadGesture::Tap => println!("Tap detected"), TouchpadGesture::DoubleTap => println!("Double tap detected"), TouchpadGesture::LongPress => println!("Long press detected"), TouchpadGesture::SwipeLeft => println!("Swipe left detected"), TouchpadGesture::SwipeRight => println!("Swipe right detected"), TouchpadGesture::SwipeUp => println!("Swipe up detected"), TouchpadGesture::SwipeDown => println!("Swipe down detected"), TouchpadGesture::PinchIn => println!("Pinch in detected"), TouchpadGesture::PinchOut => println!("Pinch out detected"), TouchpadGesture::RotateLeft => println!("Rotate left detected"), TouchpadGesture::RotateRight => println!("Rotate right detected"), } } ``` -------------------------------- ### RecordingCommand Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.RecordingCommand.html Command to start/stop recording. The `start` field determines whether to initiate or halt the recording process. ```APIDOC ## Struct RecordingCommand ### Summary ```rust pub struct RecordingCommand { pub start: bool, } ``` ### Fields - `start` (bool): Whether to start or stop recording. ``` -------------------------------- ### ControllerPlugin Ready Method Source: https://docs.rs/bevy_archie/latest/bevy_archie/plugin/struct.ControllerPlugin.html The `ready` method checks if the plugin has finished its setup. This is useful for plugins with asynchronous initialization. ```rust fn ready(&self, _app: &App) -> bool ``` -------------------------------- ### Start Simple Rumble Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleController.html Applies a simple rumble effect with specified intensity and duration to the controller. ```rust pub const fn rumble(&mut self, intensity: RumbleIntensity, duration: Duration) ``` -------------------------------- ### Start Rumble with Pattern Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleController.html Initiates a rumble effect using a predefined pattern, intensity, and duration. ```rust pub const fn rumble_pattern( &mut self, pattern: RumblePattern, intensity: f32, duration: Duration, ) ``` -------------------------------- ### Start Virtual Cursor Click Source: https://docs.rs/bevy_archie/latest/bevy_archie/virtual_cursor/struct.VirtualCursorState.html Initiates a click action for the virtual cursor. Use this when a click event begins. ```rust pub fn start_click(&mut self) ``` -------------------------------- ### IconSize Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/icons/enum.IconSize.html Provides methods to get the pixel size and asset path suffix for each icon size. ```APIDOC ## Implementations ### impl IconSize #### `pub const fn pixels(self) -> u32` Get the pixel size for this icon size. #### `pub const fn suffix(self) -> &'static str` Get the suffix for asset paths. ``` -------------------------------- ### ControllerPlugin Finish Method Source: https://docs.rs/bevy_archie/latest/bevy_archie/plugin/struct.ControllerPlugin.html The `finish` method is called after all plugins are ready, allowing for final setup steps that may depend on other plugins. ```rust fn finish(&self, _app: &mut App) ``` -------------------------------- ### DynamicBundle Implementation Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleController.html Provides methods for handling dynamic bundles, including getting and applying effects. ```APIDOC ## `get_components` ### Description Moves the components out of the bundle. ### Parameters * `ptr`: A `MovingPtr` to the component `C`. * `func`: A mutable closure that takes `StorageType` and `OwningPtr`. ### Returns The effect associated with the bundle. ``` ```APIDOC ## `apply_effect` ### Description Applies the after-effects of spawning this bundle. ### Parameters * `_ptr`: A `MovingPtr` to `MaybeUninit`. * `_entity`: A mutable reference to `EntityWorldMut`. ``` -------------------------------- ### type_id Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/enum.InputDevice.html Gets the `TypeId` of `self`. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Returns - `TypeId`: The unique type identifier of the instance. ``` -------------------------------- ### Create ActiveTouchpadBackend Source: https://docs.rs/bevy_archie/latest/bevy_archie/motion/struct.ActiveTouchpadBackend.html Create with a specific backend. Requires the backend to implement Send, Sync, and 'static. ```rust pub fn new(backend: B) -> Self ``` -------------------------------- ### Get Default Configuration File Path Source: https://docs.rs/bevy_archie/latest/bevy_archie/config/struct.ControllerConfig.html Retrieves the default configuration file path for the current operating system platform. This path is used for loading and saving settings. ```rust pub fn default_config_path() -> PathBuf ``` -------------------------------- ### poll Source: https://docs.rs/bevy_archie/latest/bevy_archie/motion/struct.ActiveTouchpadBackend.html Get touchpad data from the backend. ```APIDOC ### fn poll(&mut self) -> Option Get touchpad data from the backend. ``` -------------------------------- ### ControllerIconAssets::get_icon Source: https://docs.rs/bevy_archie/latest/bevy_archie/icons/struct.ControllerIconAssets.html Get or load an icon for a button. ```APIDOC ## ControllerIconAssets::get_icon ### Description Get or load an icon for a button. ### Signature ```rust pub fn get_icon(&mut self, icon: ButtonIcon, layout: ControllerLayout, size: IconSize, asset_server: &AssetServer) -> Handle ``` ``` -------------------------------- ### new Source: https://docs.rs/bevy_archie/latest/bevy_archie/motion/struct.ActiveTouchpadBackend.html Create with a specific backend. ```APIDOC ### fn new(backend: B) -> Self Create with a specific backend. ``` -------------------------------- ### ControllerIconAssets::get_button_icon Source: https://docs.rs/bevy_archie/latest/bevy_archie/icons/struct.ControllerIconAssets.html Get an icon for a gamepad button type. ```APIDOC ## ControllerIconAssets::get_button_icon ### Description Get an icon for a gamepad button type. ### Signature ```rust pub fn get_button_icon(&mut self, button: GamepadButton, layout: ControllerLayout, size: IconSize, asset_server: &AssetServer) -> Option> ``` ``` -------------------------------- ### Get Reference to Any Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.InputPlayback.html Converts a &Trait to &Any, enabling dynamic access. ```rust fn as_any(&self) -> &(dyn Any + 'static) ``` -------------------------------- ### Field Access Source: https://docs.rs/bevy_archie/latest/bevy_archie/gyro/struct.AccelData.html Methods for getting and setting field values by name. ```APIDOC ## fn get_field(&self, name: &str) -> Option<&T> where T: Reflect, Returns a reference to the value of the field named `name`, downcast to `T`. ``` ```APIDOC ## fn get_field_mut(&mut self, name: &str) -> Option<&mut T> where T: Reflect, Returns a mutable reference to the value of the field named `name`, downcast to `T`. ``` -------------------------------- ### From Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/action_modifiers/struct.ModifierConfig.html Methods for creating instances from other types. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ``` -------------------------------- ### Bundle Creation from Components Source: https://docs.rs/bevy_archie/latest/bevy_archie/gyro/struct.GyroData.html Create a bundle from a context and a function that provides components. ```APIDOC ## GyroData::from_components() ### Description Creates a bundle from components provided by a function. ### Method `from_components` ### Parameters - `ctx`: A mutable reference to the context `T`. - `func`: A mutable function that provides components. ### Returns - `C`: The created bundle. ``` -------------------------------- ### RumbleController::rumble_pattern Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleController.html Starts a rumble effect with a specific pattern, intensity, and duration. ```APIDOC ## RumbleController::rumble_pattern ### Description Start a rumble with pattern. ### Signature ```rust pub const fn rumble_pattern(&mut self, pattern: RumblePattern, intensity: f32, duration: Duration) ``` ### Parameters * `pattern`: RumblePattern - The pattern to play. * `intensity`: f32 - The intensity of the rumble. * `duration`: Duration - The duration of the rumble. ``` -------------------------------- ### IntoScheduleConfigs, ()> Source: https://docs.rs/bevy_archie/latest/bevy_archie/plugin/enum.ControllerSystemSet.html Methods for configuring schedules based on a SystemSet. ```APIDOC ## into_configs() -> ScheduleConfigs> ### Description Convert into a `ScheduleConfigs`. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters None ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## in_set(self, set: impl SystemSet) -> ScheduleConfigs ### Description Add these systems to the provided `set`. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters - **set** (impl SystemSet) - The system set to add systems to. ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## before(self, set: impl IntoSystemSet) -> ScheduleConfigs ### Description Runs before all systems in `set`. If `self` has any systems that produce `Commands` or other `Deferred` operations, all systems in `set` will see their effect. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters - **set** (impl IntoSystemSet) - The system set to run before. ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## after(self, set: impl IntoSystemSet) -> ScheduleConfigs ### Description Runs after all systems in `set`. If `set` has any systems that produce `Commands` or other `Deferred` operations, all systems in `self` will see their effect. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters - **set** (impl IntoSystemSet) - The system set to run after. ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## before_ignore_deferred(self, set: impl IntoSystemSet) -> ScheduleConfigs ### Description Runs before all systems in `set`. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters - **set** (impl IntoSystemSet) - The system set to run before, ignoring deferred operations. ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## after_ignore_deferred(self, set: impl IntoSystemSet) -> ScheduleConfigs ### Description Runs after all systems in `set`. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters - **set** (impl IntoSystemSet) - The system set to run after, ignoring deferred operations. ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## distributive_run_if(self, condition: impl SystemCondition + Clone) -> ScheduleConfigs ### Description Add a run condition to each contained system. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters - **condition** (impl SystemCondition + Clone) - The system condition to apply. ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## run_if(self, condition: impl SystemCondition) -> ScheduleConfigs ### Description Run the systems only if the `SystemCondition` is `true`. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters - **condition** (impl SystemCondition) - The system condition to check. ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## ambiguous_with(self, set: impl IntoSystemSet) -> ScheduleConfigs ### Description Suppress warnings and errors that would result from these systems having ambiguities (conflicting access but indeterminate order) with systems in `set`. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters - **set** (impl IntoSystemSet) - The system set to check for ambiguities with. ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## ambiguous_with_all(self) -> ScheduleConfigs ### Description Suppress warnings and errors that would result from these systems having ambiguities (conflicting access but indeterminate order) with any other system. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters None ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## chain(self) -> ScheduleConfigs ### Description Treat this collection as a sequence of systems. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters None ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` ```APIDOC ## chain_ignore_deferred(self) -> ScheduleConfigs ### Description Treat this collection as a sequence of systems. ### Method `IntoScheduleConfigs` implementation ### Endpoint N/A (Method Call) ### Parameters None ### Request Example N/A ### Response #### Success Response (ScheduleConfigs) - `ScheduleConfigs`: Configuration for a schedule. ### Response Example N/A ``` -------------------------------- ### Create ActiveMotionBackend Source: https://docs.rs/bevy_archie/latest/bevy_archie/motion/struct.ActiveMotionBackend.html Creates a new ActiveMotionBackend with a specific motion backend. The backend must be Send, Sync, and 'static. ```rust pub fn new(backend: B) -> Self ``` -------------------------------- ### Get Type Registration for TouchFinger Source: https://docs.rs/bevy_archie/latest/bevy_archie/touchpad/struct.TouchFinger.html Returns the default `TypeRegistration` for the TouchFinger type. ```rust fn get_type_registration() -> TypeRegistration> ``` -------------------------------- ### Get Connection Type Hint Source: https://docs.rs/bevy_archie/latest/bevy_archie/profiles/struct.DetectedController.html Provides a connection type hint based on common product ID patterns. Note that this is a heuristic and may not be accurate; platform-specific APIs are needed for true detection. ```rust pub fn connection_type_hint(self) -> ConnectionType ``` -------------------------------- ### GetField Trait Source: https://docs.rs/bevy_archie/latest/bevy_archie/actions/struct.ActionState.html Allows getting field values by name, with optional downcasting. ```APIDOC ## impl GetField for S where S: Struct, ### fn get_field(&self, name: &str) -> Option<&T> where T: Reflect, Returns a reference to the value of the field named `name`, downcast to `T`. ### fn get_field_mut(&mut self, name: &str) -> Option<&mut T> where T: Reflect, Returns a mutable reference to the value of the field named `name`, downcast to `T`. ``` -------------------------------- ### CloneToUninit Implementation Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleController.html Provides a nightly-only experimental API for cloning to an uninitialized memory location. ```APIDOC ## `clone_to_uninit` ### Description Performs copy-assignment from `self` to a destination pointer. ### Parameters * `dest`: A raw pointer to the destination memory location. ### Safety This is an unsafe function that requires the caller to ensure `dest` is valid and properly aligned for `T`. ``` -------------------------------- ### Poll ActiveTouchpadBackend for Data Source: https://docs.rs/bevy_archie/latest/bevy_archie/motion/struct.ActiveTouchpadBackend.html Get touchpad data from the backend. Returns Option. ```rust pub fn poll(&mut self) -> Option ``` -------------------------------- ### CloneToUninit Implementation (Nightly) Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.PlaybackCommand.html Nightly-only experimental API for copying PlaybackCommand to uninitialized memory. ```rust impl CloneToUninit for T where T: Clone, Source§ #### unsafe fn clone_to_uninit(&self, dest: *mut u8) šŸ”¬This is a nightly-only experimental API. (`clone_to_uninit`) Performs copy-assignment from `self` to `dest`. Read more ``` -------------------------------- ### Get Last Actions Source: https://docs.rs/bevy_archie/latest/bevy_archie/input_buffer/struct.InputBuffer.html Retrieves a specified number of the most recent game actions from the buffer. ```rust pub fn last_actions(&self, count: usize) -> Vec ``` -------------------------------- ### GetPath::reflect_path Source: https://docs.rs/bevy_archie/latest/bevy_archie/gyro/struct.GyroData.html Gets a reference to a value within the struct using a reflective path. ```APIDOC ## GetPath::reflect_path ### Description Returns a reference to the value specified by `path`. ### Signature `fn reflect_path<'p>(&self, path: impl ReflectPath<'p>) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>` ``` -------------------------------- ### DetectedController::new Source: https://docs.rs/bevy_archie/latest/bevy_archie/profiles/struct.DetectedController.html Creates a new instance of DetectedController with the provided vendor and product IDs. ```APIDOC ## DetectedController::new ### Description Create a new detected controller. ### Method Signature ```rust pub fn new(vendor_id: u16, product_id: u16) -> Self ``` ``` -------------------------------- ### Get Type of InputDevice Variant Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/enum.InputDevice.html Returns the VariantType of the current variant of the InputDevice enum. ```rust fn variant_type(&self) -> VariantType ``` -------------------------------- ### Load Configuration or Use Default Source: https://docs.rs/bevy_archie/latest/bevy_archie/config/struct.ControllerConfig.html Attempts to load the controller configuration from the default path. If the file is not found or invalid, it returns a default configuration. ```rust pub fn load_or_default() -> Self ``` -------------------------------- ### Get Field by Name Source: https://docs.rs/bevy_archie/latest/bevy_archie/config/struct.ControllerConfig.html Retrieves a reference to a field by its name, downcasting it to a specified type. ```APIDOC ## get_field(&self, name: &str) -> Option<&T> ### Description Returns a reference to the value of the field named `name`, downcast to `T`. ### Parameters #### Path Parameters - **name** (str) - Required - The name of the field to retrieve. #### Query Parameters - **T** (Reflect) - Required - The type to downcast the field to. ``` -------------------------------- ### ActiveMotionBackend::new Source: https://docs.rs/bevy_archie/latest/bevy_archie/motion/struct.ActiveMotionBackend.html Creates a new ActiveMotionBackend with a specific motion backend. ```APIDOC ## ActiveMotionBackend::new(backend: B) -> Self ### Description Create with a specific backend. ### Parameters #### Path Parameters - **backend** (B) - Required - The motion backend to use. ``` -------------------------------- ### RumbleController::new Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleController.html Creates a new RumbleController instance for a given gamepad entity. ```APIDOC ## RumbleController::new ### Description Create a new rumble controller. ### Signature ```rust pub fn new(gamepad: Entity) -> Self ``` ### Parameters * `gamepad`: Entity - The target gamepad entity. ``` -------------------------------- ### FromWorld Method Source: https://docs.rs/bevy_archie/latest/bevy_archie/action_modifiers/struct.ModifierConfig.html Method for creating instances from the world. ```APIDOC ## fn from_world(_world: &mut World) -> T ### Description Creates `Self` using `default()`. ### Method `from_world` ``` -------------------------------- ### From Implementation Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleController.html Provides a basic `From` implementation. ```APIDOC ## `from` ### Description Returns the argument unchanged. ### Parameters * `t`: The value to convert. ### Returns The same value `t`. ``` -------------------------------- ### Get Represented Type Info for TouchFinger Source: https://docs.rs/bevy_archie/latest/bevy_archie/touchpad/struct.TouchFinger.html Returns the `TypeInfo` of the type represented by the TouchFinger value. ```rust fn get_represented_type_info(&self) -> Option<&'static TypeInfo)> ``` -------------------------------- ### Default TouchpadConfig Implementation Source: https://docs.rs/bevy_archie/latest/bevy_archie/touchpad/struct.TouchpadConfig.html Provides a default configuration for TouchpadConfig, allowing for easy initialization. ```rust impl Default for TouchpadConfig where Self: Send + Sync + 'static, { fn default() -> Self { Self::new() } } ``` -------------------------------- ### Get TouchFinger Position as Vec2 Source: https://docs.rs/bevy_archie/latest/bevy_archie/touchpad/struct.TouchFinger.html Retrieves the normalized X and Y coordinates of the touch finger as a `Vec2`. ```rust pub fn position(&self) -> Vec2> ``` -------------------------------- ### Create New RumbleController Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleController.html Initializes a new RumbleController instance for a given gamepad entity. ```rust pub fn new(gamepad: Entity) -> Self> ``` -------------------------------- ### Create a New DetectedController Source: https://docs.rs/bevy_archie/latest/bevy_archie/profiles/struct.DetectedController.html Instantiates a new DetectedController with the provided vendor and product IDs. This is the primary way to create a DetectedController instance. ```rust pub fn new(vendor_id: u16, product_id: u16) -> Self ``` -------------------------------- ### ControllerModel Type Registration Source: https://docs.rs/bevy_archie/latest/bevy_archie/profiles/enum.ControllerModel.html Provides methods for getting the default TypeRegistration and registering type dependencies. ```APIDOC ## fn get_type_registration() -> TypeRegistration ### Description Returns the default `TypeRegistration` for this type. ### Method `fn` ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response - **TypeRegistration**: The default type registration for ControllerModel. ### Response Example None ``` ```APIDOC ## fn register_type_dependencies(registry: &mut TypeRegistry) ### Description Registers other types needed by this type. ### Method `fn` ### Endpoint N/A ### Parameters - **registry** (`&mut TypeRegistry`): A mutable reference to the TypeRegistry to register dependencies. ### Request Example None ### Response None ### Response Example None ``` -------------------------------- ### GetPath::reflect_path_mut Source: https://docs.rs/bevy_archie/latest/bevy_archie/gyro/struct.GyroData.html Gets a mutable reference to a value within the struct using a reflective path. ```APIDOC ## GetPath::reflect_path_mut ### Description Returns a mutable reference to the value specified by `path`. ### Signature `fn reflect_path_mut<'p>(&mut self, path: impl ReflectPath<'p>) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>` ``` -------------------------------- ### From Implementation for PlaybackCommand Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.PlaybackCommand.html Allows creating a PlaybackCommand from itself. ```rust impl From for T Source§ #### fn from(t: T) -> T Returns the argument unchanged. ``` -------------------------------- ### Bundle Get Component IDs Source: https://docs.rs/bevy_archie/latest/bevy_archie/icons/struct.ControllerIconDisplay.html Returns an iterator over Option for a Bundle's components. ```rust fn get_component_ids( components: &Components, ) -> impl Iterator> ``` -------------------------------- ### Any Conversion Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/multiplayer/struct.Player.html Methods for converting the Player struct to and from `Box`. ```APIDOC ## Any Conversion Methods ### `into_any` - **Description**: Returns the value as a `Box`. - **Signature**: `fn into_any(self: Box) -> Box` ### `as_any` - **Description**: Returns the value as a `&dyn Any`. - **Signature**: `fn as_any(&self) -> &dyn Any` ### `as_any_mut` - **Description**: Returns the value as a `&mut dyn Any`. - **Signature**: `fn as_any_mut(&mut self) -> &mut dyn Any` ``` -------------------------------- ### Combo::new Source: https://docs.rs/bevy_archie/latest/bevy_archie/input_buffer/struct.Combo.html Creates a new Combo instance with a given name and sequence of game actions. ```APIDOC ## impl Combo ### pub fn new(name: impl Into, sequence: Vec) -> Self Create a new combo. ``` -------------------------------- ### Get Index of InputDevice Variant Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/enum.InputDevice.html Returns the numerical index of the current variant of the InputDevice enum. ```rust fn variant_index(&self) -> usize ``` -------------------------------- ### type_id Source: https://docs.rs/bevy_archie/latest/bevy_archie/actions/struct.ActionMap.html Gets the `TypeId` of `self`. This method allows for retrieving a unique identifier for the type of the object. ```APIDOC ## fn type_id(&self) -> TypeId ### Description Gets the `TypeId` of `self`. ### Method `type_id` ### Parameters None ### Returns - `TypeId`: The unique identifier for the type of `self`. ``` -------------------------------- ### Usage of Motion Backend and Data Source: https://docs.rs/bevy_archie/latest/bevy_archie/motion/index.html This snippet shows how to use the MotionBackend and MotionData traits. The library automatically selects the best available backend, or you can inject custom data into systems like `custom_motion_system`. ```rust use bevy_archie::motion::{MotionBackend, MotionData}; // The library will use the best available backend // Or you can inject your own data: fn custom_motion_system(mut gyro_query: Query<&mut GyroData>) { for mut gyro in &mut gyro_query { gyro.set_raw(pitch, yaw, roll); } } ``` -------------------------------- ### Get Mutable Reference to Any Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.InputPlayback.html Converts a &mut Trait to &mut Any, enabling dynamic mutable access. ```rust fn as_any_mut(&mut self) -> &mut (dyn Any + 'static) ``` -------------------------------- ### try_from Source: https://docs.rs/bevy_archie/latest/bevy_archie/input_buffer/struct.BufferedInput.html Performs the conversion. ```APIDOC ## fn try_from(value: U) -> Result>::Error> where U: Into, Performs the conversion. ``` -------------------------------- ### InputPlayback Type and Ownership Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.InputPlayback.html Documentation for methods related to type checking, ownership, and cloning for InputPlayback. ```APIDOC ## fn is() -> bool ### Description Checks if the current type ā€œisā€ another type, using a `TypeId` equality comparison. This is most useful in the context of generic logic. ### Method `is` ### Type Parameters - **T** (`Any`) - The type to check against. ``` ```APIDOC ## fn to_owned(&self) -> T ### Description Creates owned data from borrowed data, usually by cloning. ### Method `to_owned` ### Returns - **T** (`T`) - The owned data. ``` ```APIDOC ## fn clone_into(&self, target: &mut T) ### Description Uses borrowed data to replace owned data, usually by cloning. ### Method `clone_into` ### Parameters - **target** (`&mut T`) - The mutable reference to the owned data to be replaced. ``` ```APIDOC ## fn clone_type_data(&self) -> Box ### Description Creates a type-erased clone of this value. ### Method `clone_type_data` ``` -------------------------------- ### GetPath::path Source: https://docs.rs/bevy_archie/latest/bevy_archie/gyro/struct.GyroData.html Gets a statically typed reference to a value within the struct using a reflective path. ```APIDOC ## GetPath::path ### Description Returns a statically typed reference to the value specified by `path`. ### Signature `fn path<'p, T>(&self, path: impl ReflectPath<'p>) -> Result<&T, ReflectPathError<'p>>` ### Type Parameters - `T`: Must implement `Reflect`. ``` -------------------------------- ### Enable DualSense Backend Feature Source: https://docs.rs/bevy_archie/latest/bevy_archie/motion/index.html To enable the DualSense backend, include the `dualsense` feature flag in your Cargo.toml file. ```toml [dependencies] bevy_archie = { version = "0.1", features = ["dualsense"] } ``` -------------------------------- ### detect_touchpad_gestures Source: https://docs.rs/bevy_archie/latest/bevy_archie/touchpad/fn.detect_touchpad_gestures.html A Bevy system that detects touchpad gestures. It takes a query for touchpads, a resource for touchpad configuration, and a message writer for gesture events. ```APIDOC ## Function detect_touchpad_gestures ### Description System to detect touchpad gestures. ### Signature ```rust pub fn detect_touchpad_gestures( gamepads: Query<'_, '_, (Entity, &mut TouchpadData)>, config: Res<'_, TouchpadConfig>, gesture_events: MessageWriter<'_, TouchpadGestureEvent>, ) ``` ``` -------------------------------- ### ButtonIcon Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/icons/enum.ButtonIcon.html Methods available for the ButtonIcon enum, including converting from GamepadButton, getting filenames, and labels. ```APIDOC ## Implementations ### impl ButtonIcon #### `pub fn from_button_type(button: GamepadButton) -> Option` Get the icon for a gamepad button type. #### `pub fn filename(self, layout: ControllerLayout, size: IconSize) -> String` Get the asset filename for this icon on a specific layout. #### `pub const fn label(self, layout: ControllerLayout) -> &'static str` Get the text label for this button on a specific layout. ``` -------------------------------- ### GetField Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/struct.InputDeviceState.html Implementation of `GetField` for types that implement `Struct`. Provides methods to get field values by name. ```APIDOC ## fn get_field(&self, name: &str) -> Option<&T> Returns a reference to the value of the field named `name`, downcast to `T`. ``` ```APIDOC ## fn get_field_mut(&mut self, name: &str) -> Option<&mut T> Returns a mutable reference to the value of the field named `name`, downcast to `T`. ``` -------------------------------- ### CloneToUninit Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/struct.InputDeviceState.html Implementation of `CloneToUninit` for types that implement `Clone`. This is a nightly-only experimental API. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) Performs copy-assignment from `self` to `dest`. ``` -------------------------------- ### Plugin Source: https://docs.rs/bevy_archie/latest/bevy_archie/all.html Defines the main controller plugin and its system sets. ```APIDOC ## ControllerPlugin ### Description The main plugin for controller input. ### Struct Definition plugin::ControllerPlugin ``` ```APIDOC ## ControllerSystemSet ### Description System sets used within the controller plugin. ### Enum Definition plugin::ControllerSystemSet ``` -------------------------------- ### Get TypeId for Any Trait Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.InputPlayback.html Retrieves the TypeId of the implementing type, used for dynamic trait object manipulation. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### RumbleRequest::new Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleRequest.html Creates a simple rumble request with specified gamepad, intensity, and duration. ```APIDOC ## RumbleRequest::new ### Description Creates a simple rumble request. ### Method `const fn new(gamepad: Entity, intensity: f32, duration: Duration) -> Self` ### Parameters - **gamepad** (Entity) - Required - The gamepad entity to apply rumble to. - **intensity** (f32) - Required - The intensity of the rumble (typically 0.0 to 1.0). - **duration** (Duration) - Required - The duration for which the rumble should last. ``` -------------------------------- ### Get Statically Typed Path Source: https://docs.rs/bevy_archie/latest/bevy_archie/config/struct.ControllerConfig.html Returns a statically typed reference to the value specified by a given path. ```APIDOC ## path<'p, T>( &self, path: impl ReflectPath<'p>, ) -> Result<&T, ReflectPathError<'p>> ### Description Returns a statically typed reference to the value specified by `path`. ### Parameters #### Path Parameters - **path** (impl ReflectPath) - Required - The path to the desired value. #### Query Parameters - **T** (Reflect) - Required - The statically typed reference to retrieve. ``` -------------------------------- ### Get Mutable Field by Name Source: https://docs.rs/bevy_archie/latest/bevy_archie/config/struct.ControllerConfig.html Retrieves a mutable reference to a field by its name, downcasting it to a specified type. ```APIDOC ## get_field_mut(&mut self, name: &str) -> Option<&mut T> ### Description Returns a mutable reference to the value of the field named `name`, downcast to `T`. ### Parameters #### Path Parameters - **name** (str) - Required - The name of the field to retrieve. #### Query Parameters - **T** (Reflect) - Required - The type to downcast the field to. ``` -------------------------------- ### StubBackend::new Source: https://docs.rs/bevy_archie/latest/bevy_archie/motion/struct.StubBackend.html Creates a new instance of the StubBackend. ```APIDOC ## StubBackend::new ### Description Create a new stub backend. ### Method `pub const fn new() -> Self` ``` -------------------------------- ### Get Enum Info for GameAction Source: https://docs.rs/bevy_archie/latest/bevy_archie/actions/enum.GameAction.html Retrieves static `EnumInfo` for the `GameAction` if available, providing metadata about the enum. ```rust fn get_represented_enum_info(&self) -> Option<&'static EnumInfo> ``` -------------------------------- ### Get Partial Reflect Reference for ActionState Source: https://docs.rs/bevy_archie/latest/bevy_archie/actions/struct.ActionState.html Casts ActionState to a reflected value. This is part of the PartialReflect trait. ```rust fn as_partial_reflect(&self) -> &dyn PartialReflect ``` -------------------------------- ### Load Controller Configuration from File Source: https://docs.rs/bevy_archie/latest/bevy_archie/config/struct.ControllerConfig.html Loads controller configuration from a specified JSON file path. This operation may fail if the file cannot be read or contains invalid JSON. ```rust pub fn load_from_file(path: impl AsRef) -> Result ``` -------------------------------- ### Create New InputDebugger Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.InputDebugger.html Initializes a new InputDebugger instance. This is the default way to create the debugger. ```rust pub fn new() -> Self ``` -------------------------------- ### Get Type Registration for ActionState Source: https://docs.rs/bevy_archie/latest/bevy_archie/actions/struct.ActionState.html Returns the default TypeRegistration for the ActionState type. This is part of the GetTypeRegistration trait. ```rust fn get_type_registration() -> TypeRegistration ``` -------------------------------- ### try_from Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.RecordingCommand.html Attempts to convert a value into a RecordingCommand. ```APIDOC ## try_from(value: U) -> Result>::Error> ### Description Performs the conversion from type `U` into `T`. ### Parameters - `value`: The value of type `U` to convert. ### Returns - `Result>::Error>`: A `Result` containing the converted value of type `T` or an error if the conversion failed. ``` -------------------------------- ### CloneToUninit Implementation Source: https://docs.rs/bevy_archie/latest/bevy_archie/icons/enum.ButtonIcon.html An experimental nightly-only API that allows cloning `ButtonIcon` values into uninitialized memory. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) where T: Clone, ``` -------------------------------- ### GetPath::path_mut Source: https://docs.rs/bevy_archie/latest/bevy_archie/gyro/struct.GyroData.html Gets a statically typed mutable reference to a value within the struct using a reflective path. ```APIDOC ## GetPath::path_mut ### Description Returns a statically typed mutable reference to the value specified by `path`. ### Signature `fn path_mut<'p, T>(&mut self, path: impl ReflectPath<'p>) -> Result<&mut T, ReflectPathError<'p>>` ### Type Parameters - `T`: Must implement `Reflect`. ``` -------------------------------- ### Get Full Path of InputDevice Variant Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/enum.InputDevice.html Returns the complete path to the current variant of the InputDevice enum as a String. ```rust fn variant_path(&self) -> String ``` -------------------------------- ### Create New InputBuffer Source: https://docs.rs/bevy_archie/latest/bevy_archie/input_buffer/struct.InputBuffer.html Initializes a new InputBuffer with a specified time window for buffering inputs. ```rust pub fn new(window: Duration) -> Self ``` -------------------------------- ### RumbleIntensity Constructors and Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleIntensity.html Provides methods for creating and managing RumbleIntensity instances. ```APIDOC ### impl RumbleIntensity #### pub const fn new(low: f32, high: f32) -> Self Create a new rumble intensity. #### pub const fn uniform(intensity: f32) -> Self Create a uniform rumble (both motors same intensity). #### pub fn none() -> Self No rumble. ``` -------------------------------- ### Get Number of Fields in InputDevice Variant Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/enum.InputDevice.html Returns the total number of fields in the current variant of the InputDevice enum. ```rust fn field_len(&self) -> usize ``` -------------------------------- ### from Source: https://docs.rs/bevy_archie/latest/bevy_archie/actions/struct.ActionMap.html Creates a new instance of the type from the given argument. This is a conversion method. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ### Parameters - `t` (`T`): The value to convert from. ### Returns - `T`: The converted value. ``` -------------------------------- ### Get Gamepad Entity Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/enum.InputDevice.html Retrieves the associated Entity for a gamepad input device. Returns None if the device is not a gamepad. ```rust pub fn gamepad(&self) -> Option ``` -------------------------------- ### Get active gamepad entity Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/struct.InputDeviceState.html Retrieves the entity associated with the active gamepad, if one is currently connected and active. ```rust pub fn active_gamepad(&self) -> Option ``` -------------------------------- ### InputBuffer Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/input_buffer/struct.InputBuffer.html Provides methods for creating, manipulating, and querying the input buffer. ```APIDOC ## InputBuffer ### Description Input buffer resource for storing recent inputs. ### Fields - `inputs: Vec`: Ring buffer of recent inputs. - `window: Duration`: Buffer window duration. - `current_time: f64`: Current game time. ### Methods #### `new(window: Duration) -> Self` Create a new input buffer with specified window. #### `push(&mut self, action: GameAction, held: bool)` Add an input to the buffer. #### `check_sequence(&self, sequence: &[GameAction], window: Duration) -> bool` Check if a sequence of actions was performed. #### `last_actions(&self, count: usize) -> Vec` Get the last N actions. #### `has_action(&self, action: GameAction, within: Duration) -> bool` Check for a specific action in the buffer. #### `clear(&mut self)` Clear the buffer. ``` -------------------------------- ### ControllerLayout Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/config/enum.ControllerLayout.html Provides methods for interacting with the ControllerLayout enum, such as detecting layout from name and getting button names. ```APIDOC ## impl ControllerLayout ### pub fn from_name(name: &str) -> Self Detect controller layout from controller name. ### pub const fn button_name(self, button: GamepadButton) -> &'static str Get the display name for a button on this layout. ``` -------------------------------- ### from_world Source: https://docs.rs/bevy_archie/latest/bevy_archie/detection/enum.InputDevice.html Creates `Self` using `default()`. ```APIDOC ## fn from_world(_world: &mut World) -> T ### Description Creates `Self` using `default()`. ### Parameters - `_world`: A mutable reference to the `World`. ### Returns - `T`: A new instance of `Self` created with default values. ``` -------------------------------- ### Try Get Reflect Reference for ActionState Source: https://docs.rs/bevy_archie/latest/bevy_archie/actions/struct.ActionState.html Attempts to cast ActionState to a fully-reflected value. This is part of the PartialReflect trait. ```rust fn try_as_reflect(&self) -> Option<&dyn Reflect> ``` -------------------------------- ### Add ControllerPlugin to Bevy App Source: https://docs.rs/bevy_archie/latest/bevy_archie/plugin/struct.ControllerPlugin.html Demonstrates how to add the ControllerPlugin to a Bevy application to enable controller support. Ensure DefaultPlugins are also added. ```rust use bevy::prelude::*; use bevy_archie::prelude::*; App::new() .add_plugins(DefaultPlugins) .add_plugins(ControllerPlugin::default()) .run(); ``` -------------------------------- ### Get All Game Actions Source: https://docs.rs/bevy_archie/latest/bevy_archie/actions/enum.GameAction.html Retrieves all available GameAction variants as a static slice. This is useful for iterating through all possible actions. ```rust pub fn all() -> &'static [GameAction] ``` -------------------------------- ### Get Reflect Kind of ActionState Source: https://docs.rs/bevy_archie/latest/bevy_archie/actions/struct.ActionState.html Returns a zero-sized enumeration of the kinds of type for ActionState. This is part of the PartialReflect trait. ```rust fn reflect_kind(&self) -> ReflectKind ``` -------------------------------- ### Create New ControllerIconAssets Source: https://docs.rs/bevy_archie/latest/bevy_archie/icons/struct.ControllerIconAssets.html Instantiates a new ControllerIconAssets resource with a specified base path for icons. ```rust pub fn new(base_path: impl Into) -> Self> ``` -------------------------------- ### Into Implementation Source: https://docs.rs/bevy_archie/latest/bevy_archie/haptics/struct.RumbleController.html Provides a generic `Into` implementation. ```APIDOC ## `into` ### Description Calls `U::from(self)`. This conversion is whatever the implementation of `From for U` chooses to do. ### Parameters * `self`: The value to convert. ### Returns A value of type `U`. ``` -------------------------------- ### InputPlayback Subscriber and Dispatch Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.InputPlayback.html Methods for attaching subscribers and dispatching events for InputPlayback. ```APIDOC ## fn with_subscriber(self, subscriber: S) -> WithDispatch ### Description Attaches the provided `Subscriber` to this type, returning a `WithDispatch` wrapper. ### Method `with_subscriber` ### Parameters - **subscriber** (`S: Into`) - The subscriber to attach. ``` ```APIDOC ## fn with_current_subscriber(self) -> WithDispatch ### Description Attaches the current default `Subscriber` to this type, returning a `WithDispatch` wrapper. ### Method `with_current_subscriber` ``` -------------------------------- ### Check if Virtual Cursor Just Clicked Source: https://docs.rs/bevy_archie/latest/bevy_archie/virtual_cursor/struct.VirtualCursorState.html Returns true if the virtual cursor's click action just started in the current frame. ```rust pub const fn just_clicked(&self) -> bool ``` -------------------------------- ### Default ComboRegistry Source: https://docs.rs/bevy_archie/latest/bevy_archie/input_buffer/struct.ComboRegistry.html Provides a default instance of ComboRegistry, typically an empty registry. This is useful for initializing the resource when the application starts. ```rust fn default() -> ComboRegistry ``` -------------------------------- ### Generic Implementations for ControllerLayout Source: https://docs.rs/bevy_archie/latest/bevy_archie/config/enum.ControllerLayout.html Documentation for blanket implementations that apply to ControllerLayout. ```APIDOC ### impl Any for T #### fn type_id(&self) -> TypeId ### impl AsBindGroupShaderType for T #### fn as_bind_group_shader_type(&self, _images: &RenderAssets) -> U ### impl Borrow for T #### fn borrow(&self) -> &T ### impl BorrowMut for T #### fn borrow_mut(&mut self) -> &mut T ### impl CloneToUninit for T #### unsafe fn clone_to_uninit(&self, dest: *mut u8) ### impl Downcast for T #### fn into_any(self: Box) -> Box #### fn into_any_rc(self: Rc) -> Rc #### fn as_any(&self) -> &(dyn Any + 'static) #### fn as_any_mut(&mut self) -> &mut (dyn Any + 'static) ### impl DowncastSend for T #### fn into_any_send(self: Box) -> Box ### impl DynEq for T #### fn dyn_eq(&self, other: &(dyn DynEq + 'static)) -> bool ### impl DynHash for T #### fn dyn_hash(&self, state: &mut dyn Hasher) ### impl DynamicTypePath for T #### fn reflect_type_path(&self) -> &str #### fn reflect_short_type_path(&self) -> &str #### fn reflect_type_ident(&self) -> Option<&str> #### fn reflect_crate_name(&self) -> Option<&str> #### fn reflect_module_path(&self) -> Option<&str> ### impl DynamicTyped for T #### fn reflect_type_info(&self) -> &'static TypeInfo ### impl Equivalent for Q #### fn equivalent(&self, key: &K) -> bool ### impl From for T #### fn from(t: T) -> T ### impl FromWorld for T #### fn from_world(_world: &mut World) -> T ### impl GetPath for T #### fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>> ``` -------------------------------- ### InputRecorder Struct Definition Source: https://docs.rs/bevy_archie/latest/bevy_archie/debug/struct.InputRecorder.html Defines the structure for recording inputs, including its active state, recorded inputs, and start time. ```rust pub struct InputRecorder { pub recording: bool, pub recorded: Vec, pub start_time: f64, } ``` -------------------------------- ### TryFrom and TryInto Methods Source: https://docs.rs/bevy_archie/latest/bevy_archie/gyro/struct.MotionGestureDetected.html Methods for attempting conversions between types, returning a `Result`. ```APIDOC ## fn try_from(value: U) -> Result>::Error> Performs the conversion. ## fn try_into(self) -> Result>::Error> Performs the conversion. ```