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

73 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.

20 Likes

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

1 Like

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

11 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).

7 Likes

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

Moderately sized PC screen vs iPhone 7


7 Likes