SFML community forums

Help => Graphics => Topic started by: dabo on December 20, 2008, 03:00:02 pm

Title: Display only a part of a string
Post by: dabo on December 20, 2008, 03:00:02 pm
Hi, is it possible to for example display only the first 200 pixels of a string of length say 250 pixels (or any length > 200 :))?
Title: Display only a part of a string
Post by: dabo on December 20, 2008, 06:32:34 pm
ok thanks. I would have needed to be able to display parts of letters. I guess I can fool the eyes though.
Title: Display only a part of a string
Post by: irri on December 20, 2008, 08:02:03 pm
Hi!
What if you want to have a dialogue box where the text appears letter by letter, or fade in.
Which is the best way to accomplish that?
Title: Display only a part of a string
Post by: dabo on January 07, 2009, 07:35:58 pm
Is there no hack that can be done? For example convert the rendered text to an image? so that the sprite method SetSubRect() can be used later.
Title: Display only a part of a string
Post by: coral on January 07, 2009, 08:17:55 pm
You can of course make a lot of ugly hacks to solve this problem.

One simple i can think of, not very general but at least a cheap solution is to draw a color in a PNG (or fileformat with support for alpha channel) and make a gradient with Your color to transparent, then just move this over the text corresponding to what you want to fade in.

WOILA INSTANT FADE!
Title: Display only a part of a string
Post by: dabo on January 07, 2009, 10:22:08 pm
I don't quite understand what you mean.