{"id":406,"date":"2024-09-28T00:50:38","date_gmt":"2024-09-28T00:50:38","guid":{"rendered":"https:\/\/johnnycarlos.com\/?p=406"},"modified":"2025-10-18T21:36:00","modified_gmt":"2025-10-18T21:36:00","slug":"godot-tutorial-camera-2d","status":"publish","type":"post","link":"https:\/\/johnnycarlos.com\/index.php\/2024\/09\/28\/godot-tutorial-camera-2d\/","title":{"rendered":"Godot Tutorial:  Camera 2D"},"content":{"rendered":"\n<p>More notes from doing tutorial of <a href=\"https:\/\/www.youtube.com\/watch?v=pBoXqW4RykE\">this video<\/a><a href=\"https:\/\/www.youtube.com\/watch?v=PDXknOG1NR0\"> <\/a><a href=\"https:\/\/www.youtube.com\/watch?v=pBoXqW4RykE\">series.<\/a> Assets from <a href=\"https:\/\/game-endeavor.itch.io\/mystic-woods\">Game Endeavor<\/a>&#8230;<\/p>\n\n\n\n<p>I finally got the game centered!  That was driving me nuts.  But <a href=\"https:\/\/www.youtube.com\/watch?v=PDXknOG1NR0\">this tutorial<\/a> finally had the information I was missing.<\/p>\n\n\n\n<p>Arrow Keys to move, Spacebar to Attack<\/p>\n\n\n\n<p align=\"center\">\n<iframe loading=\"lazy\" id=\"\" src=\"https:\/\/johnnycarlos.com\/games\/Camera2d\/index.html\" name=\"\" width=\"1152\" height=\"648\" frameborder=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/p>\n\n\n\n<p>Some notes of things I&#8217;d like to remember&#8230;<\/p>\n\n\n\n<p>Add a Camera 2D to the World node and place it on the bottom edge and then the right edge.  Under Transform, grab the x,y values and put them in the Camera 2d Limit for Right and Bottom of the camera of the Player.  Example:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"264\" height=\"329\" src=\"https:\/\/johnnycarlos.com\/wp-content\/uploads\/2024\/09\/image-12.png\" alt=\"\" class=\"wp-image-409\" srcset=\"https:\/\/johnnycarlos.com\/wp-content\/uploads\/2024\/09\/image-12.png 264w, https:\/\/johnnycarlos.com\/wp-content\/uploads\/2024\/09\/image-12-241x300.png 241w\" sizes=\"auto, (max-width: 264px) 100vw, 264px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>There are two ways to affect the screen size and centering:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Project -&gt; Project Settings -&gt; Windows -&gt; Scale<\/li>\n\n\n\n<li>Camera2D -&gt; Zoom<\/li>\n<\/ul>\n\n\n\n<p>Ultimately we landed on using Zoom over Scale.  In this case I reset Scale back to 1 and Zoom X and Y to 3:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"264\" src=\"https:\/\/johnnycarlos.com\/wp-content\/uploads\/2024\/09\/image-13.png\" alt=\"\" class=\"wp-image-412\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>I also enabled the three types of Smoothing:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"248\" height=\"356\" src=\"https:\/\/johnnycarlos.com\/wp-content\/uploads\/2024\/09\/image-14.png\" alt=\"\" class=\"wp-image-413\" srcset=\"https:\/\/johnnycarlos.com\/wp-content\/uploads\/2024\/09\/image-14.png 248w, https:\/\/johnnycarlos.com\/wp-content\/uploads\/2024\/09\/image-14-209x300.png 209w\" sizes=\"auto, (max-width: 248px) 100vw, 248px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>More notes from doing tutorial of this video series. Assets from Game Endeavor&#8230; I finally got the game centered! That was driving me nuts. But this tutorial finally had the information I was missing. Arrow Keys to move, Spacebar to Attack Some notes of things I&#8217;d like to remember&#8230; Add a Camera 2D to the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":420,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"cybocfi_hide_featured_image":"yes","footnotes":""},"categories":[22],"tags":[],"class_list":["post-406","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-godot"],"_links":{"self":[{"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/posts\/406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/comments?post=406"}],"version-history":[{"count":10,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/posts\/406\/revisions"}],"predecessor-version":[{"id":422,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/posts\/406\/revisions\/422"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/media\/420"}],"wp:attachment":[{"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/media?parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/categories?post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/johnnycarlos.com\/index.php\/wp-json\/wp\/v2\/tags?post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}