{"id":5198,"date":"2020-03-07T23:07:42","date_gmt":"2020-03-07T21:07:42","guid":{"rendered":"https:\/\/unitycoder.com\/blog\/?p=5198"},"modified":"2020-03-07T23:07:42","modified_gmt":"2020-03-07T21:07:42","slug":"scale-canvas-and-ui-with-screen-size","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2020\/03\/07\/scale-canvas-and-ui-with-screen-size\/","title":{"rendered":"Scale Canvas and UI with Screen Size"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"681\" height=\"620\" data-attachment-id=\"5199\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2020\/03\/07\/scale-canvas-and-ui-with-screen-size\/scale-ui-with-screen\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/scale-ui-with-screen.gif?fit=681%2C620&amp;ssl=1\" data-orig-size=\"681,620\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"scale-ui-with-screen\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/scale-ui-with-screen.gif?fit=681%2C620&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/scale-ui-with-screen.gif?resize=681%2C620&#038;ssl=1\" alt=\"\" class=\"wp-image-5199\"\/><figcaption>Numbers stay in the correct position and scale with screen size<\/figcaption><\/figure>\n\n\n\n<p><strong>How to:<\/strong><br>From Canvas component, Canvas Scaler:<br>&#8211; UI Scale Mode: &#8220;Scale with Screen Size&#8221;<br>&#8211; Reference Resolution : 800 x 600<br>&#8211; Screen Match Mode: Match with  Width or Height<br>&#8211; Match: 1<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"418\" height=\"132\" data-attachment-id=\"5201\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2020\/03\/07\/scale-canvas-and-ui-with-screen-size\/image-1-9\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-1.png?fit=418%2C132&amp;ssl=1\" data-orig-size=\"418,132\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-1.png?fit=418%2C132&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-1.png?resize=418%2C132&#038;ssl=1\" alt=\"\" class=\"wp-image-5201\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-1.png?w=418&amp;ssl=1 418w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-1.png?resize=300%2C95&amp;ssl=1 300w\" sizes=\"auto, (max-width: 418px) 100vw, 418px\" \/><\/figure>\n\n\n\n<p>RectTransform settings for Text TextMeshPro:<br>(other RectTransform values are default, like pivot)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"396\" height=\"368\" data-attachment-id=\"5202\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2020\/03\/07\/scale-canvas-and-ui-with-screen-size\/image-2-7\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-2.png?fit=396%2C368&amp;ssl=1\" data-orig-size=\"396,368\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-2.png?fit=396%2C368&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-2.png?resize=396%2C368&#038;ssl=1\" alt=\"\" class=\"wp-image-5202\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-2.png?w=396&amp;ssl=1 396w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-2.png?resize=300%2C279&amp;ssl=1 300w\" sizes=\"auto, (max-width: 396px) 100vw, 396px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to:From Canvas component, Canvas Scaler:&#8211; UI Scale Mode: &#8220;Scale with Screen Size&#8221;&#8211; Reference Resolution : 800 x 600&#8211; Screen Match Mode: Match with Width or Height&#8211; Match: 1 RectTransform settings for Text TextMeshPro:(other RectTransform values are default, like pivot)<\/p>\n","protected":false},"author":1,"featured_media":5202,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1160,1],"tags":[837,191,1161,650],"class_list":["post-5198","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ui","category-uncategorized","tag-scale","tag-screen","tag-size","tag-ui"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2020\/03\/image-2.png?fit=396%2C368&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-1lQ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=5198"}],"version-history":[{"count":2,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5198\/revisions"}],"predecessor-version":[{"id":5203,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5198\/revisions\/5203"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/5202"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=5198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=5198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=5198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}