Hello I am trying to have my UI auto scale based on the players screen size. Using plugins to auto scale has fixed part of my UI however the yellow image button (as shown in the video) still does not want to auto scale. Would anyone mind helping me?
I’m not sure if you need plugins for this, unless you have more specific needs.
If not, have a look at using UIAspectRatioConstraint.
Also, you should reference what plugins you mean when you’re using them and need help in a situation like this.
I am using UIAspectRatioConstraint however the yellow part does not seem to want to stay put. As for the plugin I am using Autoscale Lite. Here is a video to explain my issue better
It’s not that the yellow part isn’t scaling, it is. It’s that the margin between the yellow part and the purple part are increasing.
This can be fixed by anchor points.
Your green frame should have an anchorpoint of (1, 0.5)
Your purple frame should have an anchorpoint of (0.5, 1)
Your yellow frame should have an anchorpoint of (0.5, 0)
Your red frame should have an anchorpoint of (0, 0.5)
Thank you so much! Im new to UI, would you mind explaining how you knew the proper anchor points?
The AnchorPoint (X, Y) values are relative to the absolute size of the UI Object.
So, from 0 to 1 (as a float), X/Y determines where the point is along the UI Object, 0 being leftmost / highest, 1 being rightmost / lowest.
The AnchorPoint offsets the repositioning and resizing origin point of a UI Object, which is initially at the centre.
So, if you set the AnchorPoint to the bottom left, repositioning and resizing (via Scripts) will act as if the centre of the UI has been moved to the bottom left.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.