Add Scale Property to UIStroke

Add Scale as a mode for UIStroke

Roblox makes available, the object called ‘UIStroke’ which allows developers to create outlines around UI such as ‘Frame’ and “TextLabel”.

The issue currently is that we can only define the thickness of the stroke in terms of pixels, however it would be incredibly useful to include SCALE so that our GUI outlines look the same accross multiple devices.

Also, if this is too hard to implement because it may break the vale type, consider adding an enum type for UIStrokeSizeMode with options Scale/Offset

127 Likes

Here is an example of the current undesirable behaviour of UIStroke:

Smaller screen

Bigger screen

As you can tell, the thickness is not consistent across screen-sizes.

34 Likes

How would that work? Is it going to scale off of the x or y axis?

3 Likes

Same way it works in ‘UICorner’, it constraints to whichever axis length is shorter as the reference for the scale

20 Likes

I wish they thought this through a bit more before the API was released - the Thickness property could have been a UDim, just like UICorner’s CornerRadius.

It may also be useful for another property to be added that lets us control which axis scaling occurs on (or perhaps this could be built in to the enum e.g. Pixel, ScaleX, ScaleY, ScaleAuto with the latter representing the method UICorner uses to determine CornerRadius).

11 Likes

Want to bump this. This is so incredibly irritating when trying to optimise for multiple platforms.

Moderately sized PC screen vs iPhone 7


13 Likes

Roblox has to add this
UIStroke is basically useless without UDim
image

17 Likes

I created a plugin that achieves this behavior

8 Likes

Another horrible thing about UIStrokes is that the device emulators don’t even show the issue with them. My game looks significantly worse on an actual device. Might be something to look in to.

image

3 Likes

It has been almost over 2 years since this post was made and this feature is still no where to be found. I think UIStrokes are incredibly useful and used by many big games, with their biggest downside being that there is no simple way to scale them. Roblox, please make a scale property!

5 Likes

Either Roblox forgot about UIStrokes
Or they’re listening but they dont wanna add it

  • Forgot
  • Listening but dont wanna add

0 voters

3 Likes

All it takes is converting the Scale property to current -> UDim.new(0, current) in all games. This will keep the exact same functionality, but lets you also set scale. Might be hard to do, but possible.

3 Likes

this is doable at the moment, using CollectionService to add tags to UIStroke instances, though it would be nice if it was integrated because the only way to keep it scaled is to design the ui from a resolution then use that resolution as a fixed point.

2 Likes

It really sucks that we don’t have this yet!

Even if it’s “easy” to write a fix for, Roblox shouldn’t be a place where you have to write 1,000 “easy fixes” to make things work.

6 Likes

I agree with this, having hand-made solutions to these kind of problems clutters games and there’s no guarantee they’ll be permanent. One update could break work arounds if hacky methods had to be used.

6 Likes

@Tiffblocks I beg, please fix the issue of UIStrokes not displaying the same on all screen sizes. :pray:

There are examples in this thread of the issues at hand. My UI looks so different compared to on my phone and my TV. I want to make a shop like this but can’t properly because of this:

2 Likes

I create my UI to support different resolutions (scaling), and if the user is on a lower-res (mobile) or higher-res (4k) display, it completely messes up the design aspect I go for.

I’m begging you - please add this.

3 Likes

Please add this, it would simplify every UI Designer’s work flow by a lot, as well would make many games UI look way better.

2 Likes

This feature addition would give UIStroke an even bigger advantage over BorderSizePixel. To be honest, for me it would be the single biggest improvement over it—the other properties UIStroke already has are nice, Scale/Offset is necessary.

2 Likes

It would be based on parent scale size, however this would need to be converted to a Udim2 for it to work properly.

2 Likes