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

Author Topic: Yet another Rich Text implementation  (Read 3549 times)

0 Members and 1 Guest are viewing this topic.

fhomps

  • Newbie
  • *
  • Posts: 1
    • View Profile
Yet another Rich Text implementation
« 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:


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!

pvigier

  • Newbie
  • *
  • Posts: 17
    • View Profile
    • pvigier's blog
Re: Yet another Rich Text implementation
« Reply #1 on: November 18, 2019, 12:02:07 pm »
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?

fhomps

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Yet another Rich Text implementation
« Reply #2 on: November 20, 2019, 04:54:10 am »
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.

 

anything