|
@@ -3,6 +3,12 @@ extends Camera2D
|
|
|
export var dist_max = 900
|
|
|
export var zoom_rate = 0.001
|
|
|
|
|
|
+var view
|
|
|
+
|
|
|
+func _ready():
|
|
|
+ view = get_tree().root
|
|
|
+ view.connect("size_changed", self, "_on_size_changed")
|
|
|
+
|
|
|
func _process(_d):
|
|
|
move()
|
|
|
|
|
@@ -40,3 +46,6 @@ func center_on(players):
|
|
|
new_zoom += (dist - dist_max) * zoom_rate
|
|
|
|
|
|
zoom = Vector2(new_zoom, new_zoom)
|
|
|
+
|
|
|
+func _on_size_changed():
|
|
|
+ print("New size :", view.size)
|