How to scale up and down and keep aspect ratio?Auto Scale TextView Text to Fit within BoundsAndroid Scale Image to largest sizeDynamically scale images to fit a specified size width and heightProperly scaling or resizing an image or sprite maintaining its original aspect ratioHow to auto-scale to different screen resolutions?How to scale a UIWebview properlyHow to calculate scale based on viewport width and kept aspect ratio, with pure CSS?“Transform.SetParent(parent, false)” to another canvas, the gameobject's anchors was changed incorrectUnity UI: stretching an image over the displayUnity Scaling for all Aspect Ratios for all Android mobile devices

How to extract lower and upper bound in numeric format from a confidence interval string?

Is this story about US tax office reasonable?

Question about exercise 11.5 in TeXbook

How does apt-get work, in detail?

I think I may have violated academic integrity last year - what should I do?

Mother abusing my finances

Comment dit-on « I’ll tell you what » ?

What caused the tendency for conservatives to not support climate change reform?

What are the benefits of cryosleep?

Can a wire having a 610-670 THz (frequency of blue light) AC frequency supply, generate blue light?

What F1 in name of seeds/varieties means?

Restoring order in a deck of playing cards

Is floating in space similar to falling under gravity?

Why doesn't the Earth's acceleration towards the Moon accumulate to push the Earth off its orbit?

Do you play the upbeat when beginning to play a series of notes, and then after?

Where did the “Vikings wear helmets with horn” stereotype come from and why?

What does "Marchentalender" on the front of a postcard mean?

Preserving culinary oils

1960s sci-fi novella with a character who is treated as invisible by being ignored

Why colon to denote that a value belongs to a type?

How can I prevent interns from being expendable?

Can a Beholder use rays in melee range?

How were these pictures of spacecraft wind tunnel testing taken?

How feasible is the Delta-Glider?



How to scale up and down and keep aspect ratio?


Auto Scale TextView Text to Fit within BoundsAndroid Scale Image to largest sizeDynamically scale images to fit a specified size width and heightProperly scaling or resizing an image or sprite maintaining its original aspect ratioHow to auto-scale to different screen resolutions?How to scale a UIWebview properlyHow to calculate scale based on viewport width and kept aspect ratio, with pure CSS?“Transform.SetParent(parent, false)” to another canvas, the gameobject's anchors was changed incorrectUnity UI: stretching an image over the displayUnity Scaling for all Aspect Ratios for all Android mobile devices






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I want to keep the aspect ratio of the white square and the green rectangle above it in both portrait and landscape mode while they fill either width or height.



What it looks like



In the canvas, I've selected Scale With Screen Size and Match width or height of 0.5 value.



Canvas settings



And Board GameObject is anchored to the center



Canvas element settings



The problem is that it keeps aspect ratio but goes out of screen when it doesn't fit.



Update:
It's anchored to the middle center:
enter image description here



Update 2:
After setting anchor to min(0,0),max(1,1) now the Board is stretched inside the Canvas but inner images keep their size and go out of screen in landscape mode:



(Inside Canvas Scaler component of Canvas, I changed Match value from 0.5 to 1 Height. Now it scales down the height. It works for most of the screen sizes I see, but on very tall screens, the sides go out of screen.)
enter image description here










share|improve this question
























  • Can you expand the Anchors section of the Board object and take a new screenshot? The anchors are important here.

    – Draco18s
    Mar 24 at 16:19











  • @Draco18s Please check the last screenshot.

    – Blendester
    Mar 25 at 1:37











  • By anchoring it to the middle center you've said "don't scale this object when the parent scales." Set it to min(0,0),max(1,1)

    – Draco18s
    Mar 25 at 3:56












  • @Draco18s I tried, please check the updated screenshot

    – Blendester
    Mar 25 at 8:21

















0















I want to keep the aspect ratio of the white square and the green rectangle above it in both portrait and landscape mode while they fill either width or height.



What it looks like



In the canvas, I've selected Scale With Screen Size and Match width or height of 0.5 value.



Canvas settings



And Board GameObject is anchored to the center



Canvas element settings



The problem is that it keeps aspect ratio but goes out of screen when it doesn't fit.



Update:
It's anchored to the middle center:
enter image description here



Update 2:
After setting anchor to min(0,0),max(1,1) now the Board is stretched inside the Canvas but inner images keep their size and go out of screen in landscape mode:



(Inside Canvas Scaler component of Canvas, I changed Match value from 0.5 to 1 Height. Now it scales down the height. It works for most of the screen sizes I see, but on very tall screens, the sides go out of screen.)
enter image description here










share|improve this question
























  • Can you expand the Anchors section of the Board object and take a new screenshot? The anchors are important here.

    – Draco18s
    Mar 24 at 16:19











  • @Draco18s Please check the last screenshot.

    – Blendester
    Mar 25 at 1:37











  • By anchoring it to the middle center you've said "don't scale this object when the parent scales." Set it to min(0,0),max(1,1)

    – Draco18s
    Mar 25 at 3:56












  • @Draco18s I tried, please check the updated screenshot

    – Blendester
    Mar 25 at 8:21













0












0








0








I want to keep the aspect ratio of the white square and the green rectangle above it in both portrait and landscape mode while they fill either width or height.



What it looks like



In the canvas, I've selected Scale With Screen Size and Match width or height of 0.5 value.



Canvas settings



And Board GameObject is anchored to the center



Canvas element settings



The problem is that it keeps aspect ratio but goes out of screen when it doesn't fit.



Update:
It's anchored to the middle center:
enter image description here



Update 2:
After setting anchor to min(0,0),max(1,1) now the Board is stretched inside the Canvas but inner images keep their size and go out of screen in landscape mode:



(Inside Canvas Scaler component of Canvas, I changed Match value from 0.5 to 1 Height. Now it scales down the height. It works for most of the screen sizes I see, but on very tall screens, the sides go out of screen.)
enter image description here










share|improve this question
















I want to keep the aspect ratio of the white square and the green rectangle above it in both portrait and landscape mode while they fill either width or height.



What it looks like



In the canvas, I've selected Scale With Screen Size and Match width or height of 0.5 value.



Canvas settings



And Board GameObject is anchored to the center



Canvas element settings



The problem is that it keeps aspect ratio but goes out of screen when it doesn't fit.



Update:
It's anchored to the middle center:
enter image description here



Update 2:
After setting anchor to min(0,0),max(1,1) now the Board is stretched inside the Canvas but inner images keep their size and go out of screen in landscape mode:



(Inside Canvas Scaler component of Canvas, I changed Match value from 0.5 to 1 Height. Now it scales down the height. It works for most of the screen sizes I see, but on very tall screens, the sides go out of screen.)
enter image description here







unity3d scale






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 8:19







Blendester

















asked Mar 24 at 8:41









BlendesterBlendester

6631819




6631819












  • Can you expand the Anchors section of the Board object and take a new screenshot? The anchors are important here.

    – Draco18s
    Mar 24 at 16:19











  • @Draco18s Please check the last screenshot.

    – Blendester
    Mar 25 at 1:37











  • By anchoring it to the middle center you've said "don't scale this object when the parent scales." Set it to min(0,0),max(1,1)

    – Draco18s
    Mar 25 at 3:56












  • @Draco18s I tried, please check the updated screenshot

    – Blendester
    Mar 25 at 8:21

















  • Can you expand the Anchors section of the Board object and take a new screenshot? The anchors are important here.

    – Draco18s
    Mar 24 at 16:19











  • @Draco18s Please check the last screenshot.

    – Blendester
    Mar 25 at 1:37











  • By anchoring it to the middle center you've said "don't scale this object when the parent scales." Set it to min(0,0),max(1,1)

    – Draco18s
    Mar 25 at 3:56












  • @Draco18s I tried, please check the updated screenshot

    – Blendester
    Mar 25 at 8:21
















Can you expand the Anchors section of the Board object and take a new screenshot? The anchors are important here.

– Draco18s
Mar 24 at 16:19





Can you expand the Anchors section of the Board object and take a new screenshot? The anchors are important here.

– Draco18s
Mar 24 at 16:19













@Draco18s Please check the last screenshot.

– Blendester
Mar 25 at 1:37





@Draco18s Please check the last screenshot.

– Blendester
Mar 25 at 1:37













By anchoring it to the middle center you've said "don't scale this object when the parent scales." Set it to min(0,0),max(1,1)

– Draco18s
Mar 25 at 3:56






By anchoring it to the middle center you've said "don't scale this object when the parent scales." Set it to min(0,0),max(1,1)

– Draco18s
Mar 25 at 3:56














@Draco18s I tried, please check the updated screenshot

– Blendester
Mar 25 at 8:21





@Draco18s I tried, please check the updated screenshot

– Blendester
Mar 25 at 8:21












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322005%2fhow-to-scale-up-and-down-and-keep-aspect-ratio%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322005%2fhow-to-scale-up-and-down-and-keep-aspect-ratio%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript