Feature request: Camera rotation
Enhancement request:
The ability to rotate a Camera, affecting the viewport.

What should be added/changed?
- An attribute on a Camera,
.rotation: floatrepresenting the amount of degrees the Camera is currently rotated (default 0) - An attribute on a Camera,
.anchor: tuple[float, float]representing the point at which rotation will originate from (default center, or(self.viewport_width / 2, self.viewport_height / 2) - A method on a Camera,
.set_rotation(degrees: float, anchor: tuple[float, float] = None)which sets the rotation of the Camera.
What would it help with?
- Creating camera effects for cutscenes
- Creating games that use movement systems like those in many space-themed games, where the camera moves and the ship does not
- Creating transitions between scenes
- ... and more!
This can definitely be done and can be very powerful. One important part here is that it can break colission if someone tries to use different offsets for two sets of sprites, but I think what you get from this alone is worth it.
We can probably do this in combination with using pyglets WindowBlock Uniform Buffer Object. It has a projection and view matrix we can add to our shaders. I'm not sure if this is a 2.6.x thing or a 2.7 thing yet.
You can draw onto a sprite now, and just rotate the sprite if you like. That minimap could be rotated: https://api.arcade.academy/en/latest/examples/minimap.html#minimap
You can draw onto a sprite now, and just rotate the sprite if you like. That minimap could be rotated: https://api.arcade.academy/en/latest/examples/minimap.html#minimap
Right! That is also an option! Still cam rotation is nice to have.
Hi, camera rotation is working on arcade development (pre 2.7), but keep in mind that rotation breaks collision detection at the moment.