How can i zoom in with a Camera2dBundle? #5904
-
Hi! I wanna zoom with my Camera2dBundle that i apply like this: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In a system, get the OrthographicProjection associated with the Camera2d and set the scale there:
Spawning the bundle is the same as spawning and then inserting a bundle. Inserting a bundle is inserting several components simultaneously. When you use a bundle, it's worth looking up the payload of components that are added. For Camera2dBundle, that's here: https://docs.rs/bevy/latest/bevy/core_pipeline/core_2d/struct.Camera2dBundle.html You can see in the list it includes an OrthographicProjection which you can manipulate. |
Beta Was this translation helpful? Give feedback.
In a system, get the OrthographicProjection associated with the Camera2d and set the scale there:
Spawning the bundle is the same as spawning and then inserting a bundle. Inserting a bundle is inserting several components simultaneously. When you use a bundle, it's worth looking up the payload of components that are added. For Camera2dBundle, that's here:
https://docs.rs/bevy/latest/bevy/core_pipeline/core_2d/struct.Camera2dBundle.html
You can see in the list it includes an OrthographicProjection which you can manipulate.