Room-bounded 2D camera with eased transitions
In your harnessGodot componentMIT
Keep a 2D camera inside the room that contains the target, center it in rooms smaller than the view, and ease across with smoothstep when the target enters another room.
ATTRIBUTION.mdLICENSEREADME.mdbaltor_test.gdcamera_room_bounds.gdcomponent.jsoninspect_gdscript.pyrun_tests.gdtest_package.pytests/test_camera_room_bounds.gdverification/native.json
Full files in your harness.
What it takes and gives
- Class
- BaltorRoomCamera2D, extends Node
- Methods
- add_room(area: Rect2) -> int; room_at(point: Vector2) -> int; clamp_center(center: Vector2, view_size: Vector2, area: Rect2) -> Vector2; update_center(camera_center: Vector2, target: Vector2, view_size: Vector2, delta: float) -> Vector2; get_current_room() -> int; is_transitioning() -> bool
- Signals
- room_changed
- Exports
- camera_path, target_path, rooms, transition_time
- Placement
- res://baltor/godot_components/camera_room_bounds/
Limits. Axis-aligned rectangular rooms only. Overlapping rooms keep the current room until the target leaves it. The view size comes from the viewport and the camera zoom. 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, 75.2 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
- camera clamping to rectangles, smoothstep transition between rooms
- Tags
- camera, camera2d, metroidvania, rooms, camera limits, transitions
- Identity
library.supply.creative_originals.574c7417c22c18795ec76ae6.4df1966c354c7476- Version
4df1966c354c7476eff69e86b435cc11a370af7543eca99f45fbfe12d2bc9553
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.