Skip to content

Commit f1d044d

Browse files
committed
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.
1 parent 0e3444e commit f1d044d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

addons/block_code/examples/pong_game/pong_game.tscn

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,12 @@ script = ExtResource("3_6jaq8")
10631063
block_script = SubResource("Resource_6drva")
10641064

10651065
[node name="HUD" parent="." instance=ExtResource("8_yg457")]
1066+
follow_viewport_enabled = true
10661067

10671068
[node name="BlockCode" type="Node" parent="."]
10681069
script = ExtResource("3_6jaq8")
10691070
block_script = SubResource("Resource_f070g")
1071+
1072+
[node name="Camera2D" type="Camera2D" parent="."]
1073+
position = Vector2(960, 540)
1074+
zoom = Vector2(0.6, 0.6)

0 commit comments

Comments
 (0)