Hi! I tried finding some documentation about this but I can’t really get it to work, is there a way to set a shadow on the text?
It should be possible but I can’t find any example, other than that I would want to know how to change the color with a new one in another function if that’s possible.
Hi,
I found in the source code some functions for the shadow, these functions are available on the device text_block:
# The direction the shadow is cast. Used only during initialization of the widget and not modified by SetShadowOffset.
DefaultShadowOffset
# The color of the shadow. Used only during initialization of the widget and not modified by SetShadowColor.
DefaultShadowColor
# Sets the direction the shadow is cast.
SetShadowOffset
# Gets the direction the shadow is cast.
GetShadowOffset
# Sets the color of the shadow.
SetShadowColor
# Gets the color of the shadow.
GetShadowColor
# Sets the opacity of the shadow.
SetShadowOpacity
# Gets the opacity of the shadow.
GetShadowOpacity
You can add more property values when creating the text_block var _ui: text_block = text_block{DefaultTextColor:= color{R:=1.0, G:=1.0, B:=1.0}, DefaultShadowColor:= color{R:=0.0, G:=0.0, B:=0.0}, DefaultShadowOffset:= option{vector2{X:=2.0, Y:=2.0}}}
Also seems like you were getting stuck on ?vector2? Anytime you see ? in Verse, that is an option variable, meaning it may or may not have a value. So in the example of a vector2, its either a value of vector2{X:=2.0, Y:=2.0} or false. And you wrap the ?property like this option{value}.
Oh, I didn’t know that “?” meant “option{}”, thank you! But the problem for some reason still persists, I still can’t see the shadow, I’m doing something wrong?
From the UEFN Verse docs, this is the correct way to set the shadow. But it might just be a bug that its not working, just like a lot of things in UEFN…
DefaultShadowColor
color
The color of the shadow. Used only during initialization of the widget and not modified by SetShadowColor.
DefaultShadowOffset
?vector2
The direction the shadow is cast. Used only during initialization of the widget and not modified by SetShadowOffset.
It seems so weird to me, I saw other modes on UEFN where this seems to work, maybe they all used the HUD device, I never touched it so I don’t even know how it works lol
Yes, this actually helped! Didn’t work for text color though, but I understood what the issue was - color RGB values should be in range of [0;1]. After changing that both issues resolved
For ones interested - you can see all the available options by Ctrl-Clicking text_block. Then you’ll see all the methods you can use, and by clicking text_base you’ll see even more.
Thank you for this post!
The problem for me was the shadow offset.
In UMG you can set a low value such as X = 0.2, Y = 0.2 but in Verse to see any results the value needs to be much higher:
option{ vector2{ X:=4.0, Y:= 4.0 } }