SFML community forums
General => SFML projects => Topic started by: fhomps on November 08, 2019, 08:05:31 am
-
Hello everyone,
I have been toying around with SFML for a few years, and was always frustrated with the lack of flexibility of the text function - though I fully understand that rich text features are not really compatible with SFML's philosophy. I know other implementations of rich text libraries have already been done, I just wasn't fully satisfied with their design or features (and wanted to test my mettle and make my own!).
So here you go: https://github.com/FHomps/RichText
Features:
- Rich text! Use html-like beacons to change features of your text from the string.
- If you want a beacon to be code-bound, you can give it an ID and change it from the program.
- Set a character limit and update it quickly to make text stream on the screen.
- Automatic carriage returns!
- Transformable!
- Unnecessarily fast! I went back to vertex arrays instead of frankensteining sf::Text classes together. All updates to the text should only update a minimal amount of vertices; much better than redrawing the entire text.
Here's a very ugly .gif:
(https://raw.githubusercontent.com/FHomps/RichText/master/Resources/RichText.gif)
While I am proud of the project, I am by no means a professional or even good programmer - use at your own risk.
Have fun!
-
Impressive work! Even if you make me blind with your gif :P
What was your motivation to implement this feature? You plan to use this in a game?
-
Impressive work! Even if you make me blind with your gif :P
What was your motivation to implement this feature? You plan to use this in a game?
Sorry for the induced blindness, I like my old-school magenta backgrounds 8)
This was more of a toy project than anything, to dust off my knowledge of templating & member pointers in C++, and to get back into vertex arrays. I don't have the time to make a game just yet! Maybe one day.