Skip to content

Add a Using Camera2D section and share the projector tests - #2962

Merged
pvcraven merged 1 commit into
developmentfrom
camera-docs-and-tests
Oct 9, 2026
Merged

pvcraven merged 1 commit into
developmentfrom
camera-docs-and-tests

Conversation

@pvcraven

@pvcraven pvcraven commented Oct 9, 2026

Copy link
Copy Markdown
Member

Closes #2239

Docs. The camera guide starts with a short "Using Camera2D" section:

  • a world camera and a GUI camera
  • following the player, smoothly or directly
  • zooming
  • mouse positions with unproject
  • match_window on resize

It links to the platformer, split screen and minimap examples. The rest of the page is unchanged.

Tests. The orthographic and perspective projector test files were copies of each other. They are merged into tests/unit/camera/test_projectors.py:

  • use and activate run for every camera type: orthographic, perspective, Camera2D, viewport and default. Camera2D had no tests for these before. activate is also checked to restore the previous camera.
  • The map_coordinates, move and rotate tests run for both 3D projectors at three window sizes. The only difference between the two is the expected depth.
  • The orthographic zoom test is kept as is.

Camera tests: 118 → 124. The full suite, ruff, mypy, pyright and the docs build all pass.

🤖 Generated with Claude Code

The camera guide starts with how to use Camera2D: following the player,
zooming, mouse positions and resizing. The duplicated orthographic and
perspective projector tests are merged into one parametrized file, and
use/activate are now tested for every camera type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pvcraven
pvcraven merged commit 99024f3 into development Oct 9, 2026
7 checks passed
@pvcraven
pvcraven deleted the camera-docs-and-tests branch October 9, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide full and comprehensive docs for the new Camera module

1 participant