SFML community forums

Help => Graphics => Topic started by: switlle on January 11, 2014, 10:46:51 pm

Title: Font effects
Post by: switlle on January 11, 2014, 10:46:51 pm
In moddern games we are used to see nice texts with borders, shaddows or glow.

How to realize this effects in SFML? Maybe shaders or any other ways?
Title: Re: Font effects
Post by: Daddi on January 11, 2014, 10:53:58 pm
There is no easy method for special effects like that, but you can fake some of them pretty easily:

Shadow: Render your text twice, once normal, once dark with a slight offset (render the normal text above the "shadow" text)

Border: Similar, but this time the "border" text that lies behind the normal text has to be a bit bigger (and also needs an offset to the top left corner)

Glow is a little "harder", but can be achived in a similar way. Just render the text twice and use a shader to blur the underlying text :)
Title: Re: Font effects
Post by: zsbzsb on January 11, 2014, 11:16:48 pm
You can do as Daddi suggested, but if you are looking for the "professional" method for doing this the answers lie within shaders.