leafwing_input_manager::user_input::testing_utils

Trait FetchUserInput

source
pub trait FetchUserInput {
    // Required methods
    fn read_pressed(&mut self, input: impl Buttonlike) -> bool;
    fn read_axis_value(&mut self, input: impl Axislike) -> f32;
    fn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2;
}
Expand description

A trait used to quickly fetch the value of a given UserInput.

This can be useful for testing purposes.

Required Methods§

source

fn read_pressed(&mut self, input: impl Buttonlike) -> bool

Returns true if the given Buttonlike input is currently pressed.

source

fn read_axis_value(&mut self, input: impl Axislike) -> f32

Returns the value of the given Axislike input.

source

fn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2

Returns the value of the given DualAxislike input.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FetchUserInput for App

source§

fn read_pressed(&mut self, input: impl Buttonlike) -> bool

source§

fn read_axis_value(&mut self, input: impl Axislike) -> f32

source§

fn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2

source§

impl FetchUserInput for World

source§

fn read_pressed(&mut self, input: impl Buttonlike) -> bool

source§

fn read_axis_value(&mut self, input: impl Axislike) -> f32

source§

fn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2

Implementors§