Jump to content
  • Advertisement
Sign in to follow this  
pflegit

2D game engine with rich text support

This topic is 954 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm interested in creating a 2D game that will contain a large amount of dialogue. I'm looking for a game library or 2D rendering library with good support for rich text. Specifically, I need to be able to change certain words to be different colors, and certain characters to be italic while other are non-italic, all in the same piece of text.

 

I'll also need a way to tell the width in pixels of a piece of text, so that I can determine when it's about to overflow the current line of the dialogue box. I'll be creating a line of dialogue by appending characters to it, one character at a time.

 

Has anyone had experiences with a library like this? I have tried things like SDL and SFML in past and they have no support for text operations like this. Sometimes it's hard just to get text which is properly anti-aliased.

 

I'm not interested in using a visual novel engine like Ren'Py because it's too limiting (my game will contain a lot more than just dialogue).

Share this post


Link to post
Share on other sites
Advertisement

I dont know your preferred rendering API (GL/Vulkan/DX) but you may use this or adapt this one I found awhile ago on the net when searching for how to render debug text for my game engine as well.

 

https://github.com/podgorskiy/SimpleText

 

It has nearly anything you wished for in a way that you could follow what happens in the code more easy than in any other library I worked with

Share this post


Link to post
Share on other sites
https://github.com/podgorskiy/SimpleText

 

It has nearly anything you wished for

 

Actually it's quite the opposite to what pflegit asked.

It doesn't return text width, and there's no attempts to calculate it.

There's single fixed-width bitmap font embedded. No way to use external fonts, no bold/italic styles.

Render is very inefficient, drawing single letter at a time, setting every letter position, fg/bg color, texture coordinates with a bunch of glUniform calls. It might practically kill app drawing lots of text.

Library's own texture/shaders/buffers management might not fit to hosting application's ecosystem.

 

In short - it's enough to quickly see debug messages in your GL sample app, but it's not the right tool for dialogue systems.

Edited by vstrakh

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!