I am trying to achieve something similar to what this post references, but the answer given was to use UISizeConstraints. The problem with UISizeConstraints is that you can only set an Offset constraint, not a Scale constraint, which I need because my UI is based off of Scale sizes. Is there a way to combat this besides doing it manually?
Your example made me think about the way CSS tackles this problem (with the @media
tag). It essentially works like a bunch of if-statements put together that take in the size of a window:
@media (max-width: 400px) {
body {
width: 13px;
}
}
@media (min-width: 400px) {
body {
width: 42px;
}
}
@media (min-width: 800px) {
body {
width: 69px;
}
}
Unfortunately, Rōblox does not yet supply that functionality yet. Rbx.Lua however has a built-in method called BindToRenderStep
, which could essentially update your UI scale every frame. I don’t think it’s even take more than 20 lines of code on your end, so writing the code manually would be my best bet.