Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Text display problem  (Read 1322 times)

0 Members and 1 Guest are viewing this topic.

Dark254

  • Newbie
  • *
  • Posts: 3
    • View Profile
Text display problem
« 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? :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10823
    • View Profile
    • development blog
    • Email
Re: Text display problem
« Reply #1 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Text display problem
« Reply #2 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.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Dark254

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Text display problem
« Reply #3 on: October 09, 2020, 08:45:20 am »
Ok, thank you guys. I solved this!

 

anything