Use rich text tags to add stroke to inline text segments.
A bit funny, but it is possible. But the docs also specifically mention the word inline. For separate areas on the Rich Text.
Rich Text has special features (like larget text scaling). It is questionable whether they’re intended or not, but it’s better for Roblox to not break these features without fixing and keeping the features as fixed versions. My private video for Staff, explains more why.
Re-production Steps
Setup ScreenGui in StarterGui
Setup TextLabel
Turn on RichText for the TextLabel
Try to add UIStroke under the TextLabel
Observe
Expected Results
That the UIStroke on Rich Text will give me a Base Stroke Style.
Actual Result
It even displays me this even though it’s not doing anything.
Just bumping this because it makes it annoying to use Rich Text. Any UIStroke styling applied to text will be overriden, and then I am forced to convert all that styling into the rich text format which is just pointless busy-work.
Hey, this issue is fixed and rolled out now! All 3 types of stroke, RichText#stroke, UIStroke, and TextStroke, should all overlap properly and work as intended now.
What I question though is whether UIStroke should be superior and define base values. If I wrap a portion of a text inside <stroke></stroke> I am able to modify the stroke, but if I only wanted to modify the color and keep UIScale’s thickness, I can’t. The thickness from the UIScale doesn’t apply over, I have to use thickness and set it manually.
But what would be the point of that? What would the ideal solution be? Wrap the entire text inside <stroke> itself to provide “base values” ?
Isn’t that what UIStroke is supposed to do already?
Though, based on how <stroke> works, doing <stroke color="#ff0000">Test <stroke>hello</stroke></stroke> already makes “hello” have a black stroke, instead of red, so I guess <stroke> never had this sort of “inheritance”.
The Roblox team (or you) released a significant fix without any announcement, but thanks a lot! I thought it was an intended feature, but now it’s so much better. I no longer have to use etc., for BillboardGuis
I just went through my game and fixed a few ‘oopsies’ where we had UIStrokes on RichText without us knowing, if anyone else has to do that here a command prompt:
local Selection = game:GetService("Selection")
local Stop = false
for _,v in ipairs(game:GetDescendants()) do
if Stop then
break
end
pcall(function()
if v.RichText == true and v:FindFirstChildOfClass("UIStroke") then
local Stroke = v:FindFirstChildOfClass("UIStroke")
--Stop = true
print(Stroke)
--Selection:Set({Stroke})
end
end)
end