From f1d044d517951e69cdb3d9b3f3fe0a7419e56e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= Date: Mon, 24 Jun 2024 14:30:04 -0300 Subject: [PATCH] Add camera to fit default project size The Godot project size defaults to 1152x648 which is 60% of the viewport in Pong. So adding a camera with 0.6 zoom makes the game fit in the default viewport. And makes it look odd in other sizes. Also now the HUD layer follows the viewport size. --- addons/block_code/examples/pong_game/pong_game.tscn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/block_code/examples/pong_game/pong_game.tscn b/addons/block_code/examples/pong_game/pong_game.tscn index ee0d3b6a..01fa48b9 100644 --- a/addons/block_code/examples/pong_game/pong_game.tscn +++ b/addons/block_code/examples/pong_game/pong_game.tscn @@ -1063,7 +1063,12 @@ script = ExtResource("3_6jaq8") block_script = SubResource("Resource_6drva") [node name="HUD" parent="." instance=ExtResource("8_yg457")] +follow_viewport_enabled = true [node name="BlockCode" type="Node" parent="."] script = ExtResource("3_6jaq8") block_script = SubResource("Resource_f070g") + +[node name="Camera2D" type="Camera2D" parent="."] +position = Vector2(960, 540) +zoom = Vector2(0.6, 0.6)