bevy_pancam
A 2d-camera plugin for bevy that works with orthographic cameras.
The motivation is that this could be used for something like a map editor for a 2d game.
Controls
Behaves similarly to common online map applications:
- Click and drag to move the camera
- Scroll to zoom
Usage
Add the plugin to your app
build
.add_plugins
.add_plugin;
Add the component to an orthographic camera:
commands.spawn_bundle
.insert;
This is enough to get going with sensible defaults.
Alternatively, set the fields of the PanCam component to customize behavior:
commands.spawn_bundle
.insert;
See the simple and toggle examples.
Cargo features
bevy_eguimakes pancam cameras not react when the mouse or keyboard focus is on widgets created withbevy_egui
Bevy Version Support
The main branch targets the latest bevy release.
I intend to support the main branch of Bevy in the bevy-main branch.
| bevy | bevy_pancam |
|---|---|
| 0.8 | 0.5, 0.6, main |
| 0.7 | 0.3, 0.4 |
| 0.6 | 0.2 |
| 0.5 | 0.1 |
License
MIT or Apache-2.0
Contributions
PRs welcome!