Group camera that zooms to fit several targets
In your harnessGodot componentMIT
Center a Camera2D on several targets and zoom so all of them fit with a margin, within zoom limits and with smoothing, for local multiplayer and boss fights.
ATTRIBUTION.mdLICENSEREADME.mdbaltor_test.gdcomponent.jsoninspect_gdscript.pyrun_tests.gdtest_package.pytests/test_zoom_to_fit_2d.gdverification/native.jsonzoom_to_fit_2d.gd
Full files in your harness.
What it takes and gives
- Class
- BaltorGroupCamera2D, extends Camera2D
- Methods
- fit(points: PackedVector2Array, view_size: Vector2, border: float, smallest: float, largest: float) -> Dictionary; update_camera(points: PackedVector2Array, view_size: Vector2, delta: float) -> void
- Exports
- targets, margin, min_zoom, max_zoom, follow_speed
- Placement
- res://baltor/godot_components/zoom_to_fit_2d/
Limits. Fits the axis-aligned bounds of target positions, not their sprites; raise the margin for large characters. Uses the viewport size, so stretch settings change the result. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.
Details
- Kind
- Godot component
- Engine
- Godot 4.3 or later
- Files
- 11 files, 72.5 KB
- Licence
- MIT
- Declared effects
- reads files, runs commands
- Checked with
- Godot 4.7.2, headless
- Checks
- godot parse check only, godot gdscript tests, godot tests reject gutted component, godot editor import, godot contract reflection, godot readme usage compiles
- Techniques
- bounding box framing, aspect-aware zoom fit, exponential smoothing
- Tags
- camera, camera2d, zoom, multiplayer, framing, group camera
- Identity
library.supply.creative_originals.d543aedc2358fc05f20e43d9.945051ad18f4bbbc- Version
945051ad18f4bbbc48ac17191ea59feb8efc606aa1124a6940afe4bcf057e941
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.