SFML community forums
General => Feature requests => Topic started by: Thratur on August 27, 2009, 05:44:52 pm
-
Hi!
I was using SDL for a long time and I used SDL_TTF. Later, I installed SFML and I was very happy about it. I like it a lot and it is much more simpler and strings are better than with SDL_TTF by far. However, there's one thing I can't do with SFML that I could with SDL_TTF, because it was a big texture rather than small letters textures. I can't take my string and cut it where I want just to have a part of a letter and the rest of the string or any other sub rectangle.
I think it would be nice to have a function that takes the sub rectangle coordinates and draw a sub part of the string or that return a sf::sprite that I could then sub-rect myself without any problem.
I may have forgot a function that could do that, but I looked for a while in the documentation, and I couldn't find anything. So, what do you think of my idea? I won't care if it's a bad suggestion.
-
Render to image will (is?) be implemented in SFML 2, I believe that's what you want.
-
Well, if we'll be able to do that in SFML2, then there isn't any problem.
However, I believe that the first solution (directly drawing the sub rectangle from the string) would be lighter, easier to add, and simpler to use.
Thanks for the answer!
-
sf::String will be rewritten in SFML 2. Plus, clipping masks may also be added soon. So don't worry, you just have to wait ;)
-
Will those masks be added to SFML2, too?
-
If I can come up with a robust and clean public API, hopefully yes :)
-
Hi,
thank you very much for the answer! I'm happy that SFML 2 will handle this and I'll be waiting for it.
-
Will that clipping mask be only available for sf::String or other sf::Drawables aswell? (sf::Sprite already has SetSubRect(); don't know if a clipping mask is wanted for other sf::Drawables).
If so, I'd suggest sf::String::SetClipMask( const sf::IntRect & ). ;)
(well, the main reason why I'm writing this is to bump the thread; a feature like this is hardly needed at my side ;))
-
Yes, it would be a generic feature that would apply to everything that is rendered.
-
Okay, so I guess it'll take some time to get implemented. Anyway, thanks for the reply.