Map size and camera bounds

This commit is contained in:
gamer147
2026-04-07 07:41:43 -04:00
parent b086c7d181
commit 344efee7b4
4 changed files with 16 additions and 0 deletions

View File

@@ -3,3 +3,10 @@ class_name CameraController extends Camera2D
func apply_drag(delta: Vector2) -> void:
position += delta / zoom
func set_map_bounds(rect: Rect2) -> void:
limit_left = int(rect.position.x)
limit_top = int(rect.position.y)
limit_right = int(rect.position.x + rect.size.x)
limit_bottom = int(rect.position.y + rect.size.y)