Crates.io | bevy_touch_camera |
lib.rs | bevy_touch_camera |
version | 0.1.2 |
source | src |
created_at | 2023-08-27 16:00:11.940623 |
updated_at | 2024-01-12 23:17:04.705082 |
description | Touch camera for Bevy that supports drag and pinch to zoom |
homepage | https://github.com/d-bucur/bevy_touch_camera |
repository | https://github.com/d-bucur/bevy_touch_camera |
max_upload_size | |
id | 956169 |
size | 107,045 |
A plugin for touch based camera movement. Supports one finger drag to pan and two finger pinch to zoom.
Add TouchCameraPlugin
to your app.
App::new().add_plugins((
DefaultPlugins,
TouchCameraPlugin::default()
)).run();
You can configure some of the parameters of the plugin. Changing configuration at runtime is currently not supported. 1
let config = TouchCameraConfig {
drag_sensitivity: 2.,
touch_time_min: 0.2,
..Default::default()
};
app.add_plugins((TouchCameraPlugin {config}))
The plugin will try to attach itself to a camera. This can be done in either one of the following ways:
Camera
component before the PostUpdate
schedule. The plugin will attach itself automatically to it.TouchCameraTag
component to the camera entity you want to be handled by the plugin. Useful if you have multiple active cameras or if method 1) is not possible.bevy_touch_camera | bevy |
---|---|
0.1 | 0.11 |
0.1.2 | 0.12 |
Either one:
TODO maybe it is, need to test it and update example ↩