SFML community forums

Help => Graphics => Topic started by: Dark254 on October 05, 2020, 07:23:28 pm

Title: Text display problem
Post by: Dark254 on October 05, 2020, 07:23:28 pm
Hello everyone!

I want to implement creeping line like in visual novels. I tried to tie the output to the time, created additional lines, tried to draw the output by characters, but nothing helped.

Can you help me please? How can i do it with SFML? :)
Title: Re: Text display problem
Post by: eXpl0it3r on October 06, 2020, 08:54:09 am
I think, you may need to be a bit more specific what "creeping line" is exactly.

A lot of effects you see in games, are often just textures rendered on top of things or some shaders.
Title: Re: Text display problem
Post by: Hapax on October 06, 2020, 07:26:17 pm
I was not familiar with this term but it seems you want a simple text "scroller" or "marquee"?

Normally you can achieve this by animating the entire text's position (probably towards the left). If you want them cropped, the simplest way is to draw over the area they shouldn't appear although you could use a form of clipping to do it too.

Another way would be to draw it to a render texture and then animate the texture rectangle to move (probably to the right) but keep its size. Then draw that texture to the window using a sprite or rectangle.
Title: Re: Text display problem
Post by: Dark254 on October 09, 2020, 08:45:20 am
Ok, thank you guys. I solved this!