Skip to content

Documentation for SubCameraView is confusing and bad #20251

@BigWingBeat

Description

@BigWingBeat

For context, I was trying to create a magnifier that zooms in on part of the screen. The example for SubCameraView explicitly lists this as one of its intended use cases, however after ~1 hour of reading the example code, the associated documentation, and trying to implement it myself, I couldn't figure it out.

I then looked at the render-to-texture example and successfully used that feature instead to implement the magnifier as I wanted in just a few minutes.

Some of the issues I had with the SubCameraView docs include:

  • The example is cluttered and overcomplicated, with 8 different cameras crammed into a single screen. This makes it very difficult to understand just what exactly any single camera is actually doing with the feature in question.
  • The units used by SubCameraView are undocumented. Through experimentation I'm pretty sure it's physical pixels, but that isn't mentioned anywhere that I could find.
  • The fields on the type are described using terms like "size" and "offset", which makes you think their effect is "linear", but they actually describe a ratio, which has a "proportional" effect instead.
  • The fact that it's actually a ratio, despite being critical information, is only mentioned once at the bottom of the type's documentation, and isn't even phrased as an explanation. Instead, it presumes that you are already aware of that being the case, and is just explaining some part of the unhelpful example instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-DocsAn addition or correction to our documentationC-ExamplesAn addition or correction to our examplesC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions