Skip to content

Add a simple 2D camera controller #21468

@alice-i-cecile

Description

@alice-i-cecile

Problem

With the merging of #20215, we've created the bevy_camera_controller crate, and have kicked it off with a freecam for 3D. We intend to improve this with the addition of a panorbit camera, per #19741.

However, neither of these are well-suited to 2D games, whether they are top-down or side-view. We should have a controller for these applications as well: allowing users to add a quick-and-dirty debug camera, and laying the foundation for support in the editor.

Proposed solution

Add a simple RTS-style panning camera, probably called PanCamera. Control it with WASD, add QE rotation, zoom with mousewheel or +/-.

Like the freecam, this should have its own module, feature flag and dedicated example.

Edge panning should be omited: it's not very useful and can lead to frustrations when trying to manipulate objects at the edge of a deliberately chosen view or when moving the mouse off the viewport to access tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CameraUser-facing camera APIs and controllers.A-Dev-ToolsTools used to debug Bevy applications.C-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesM-Release-NoteWork that should be called out in the blog due to impactS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed upon

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions