Archive 17/01/2023.

Can’t Set Text Shadow Offset

evolgames

I’ve been doing a simple HUD with some windows and text elements. Stroke effects work as expected, and thickness can be changed from its default of 1. I’ve set stroke effects on the bottom right text. However, setting shadow offset with:

SetEffectShadowOffset (const IntVector2 &offset)

doesn’t seem to work. The shadow only disappears. Here is the default (which is Vector2(1,1) which I’ve applied to the (crude) fps counter in the top left.


Screenshot_2021-03-22_00-50-45

It’s alright for the default, but when any offset value is set it is gone. I’ve tried 1.1, .99, even PIXEL_SIZE but nothing seems to work.


I can use stroke effects only I guess, but I was hoping to use drop shadows with variable offset. Anyone run into the same issue?

Lys0gen

SetEffectShadowOffset (const IntVector2 &offset)

Note that it’s an IntVector.

                    font->SetTextEffect(Urho3D::TextEffect::TE_SHADOW);
                    font->SetEffectShadowOffset(Urho3D::IntVector2(10, 10));

Works fine for me.

evolgames

Oh whoops. Just needed ‘int’ before it. I’m a dummy. Thank you