demiculus Posted December 24, 2018 Share Posted December 24, 2018 Bitmap Text gives much better performance for dynamically changing Text. (source) Text has more attributes and is easier to change it's style. Bitmap Text has better better performance but static when it comes to styling. From this I understand that every text should be Bitmap Text except for some edge cases which Bitmap Text doesn't help. Have I understood this correctly or am I missing a part? Quote Link to comment Share on other sites More sharing options...
lgibson02 Posted December 24, 2018 Share Posted December 24, 2018 Bitmap text will also not size like normal text, it will become blocky or illegible if you try to use a size different from it's original. You might also have trouble displaying text that contains characters which are not in your image. Here for example the text has actually been set to "5¬5" but since ¬ is not in this font it is just missed out. I believe you can get around this by setting a fallback font to use for unknown characters but these won't fit with the style of the rest of the text. If you know exactly what you're using the text for perhaps we could give you better guidance. Quote Link to comment Share on other sites More sharing options...
demiculus Posted December 24, 2018 Author Share Posted December 24, 2018 38 minutes ago, lgibson02 said: If you know exactly what you're using the text for perhaps we could give you better guidance. As I remember someone posted something like this: `using bitmap text is your solution 99% of the time` here. But later someone deleted that post. So I was wondering if that is the reason my computer heats up when I play my game. Quote Link to comment Share on other sites More sharing options...
themoonrat Posted December 24, 2018 Share Posted December 24, 2018 It really depends on your needs. Bitmap text is faster to render, yes, because normal text requires generating and uploading a new texture to the GPU each time it changes. And every piece of text also requires it's own texture, which can mount up. But, as you say, normal Text gives you much more flexibility at runtime to create different styled text. And if you're supporting other languages, much easier to use normal Text than trying to create bitmap fonts for every character set..... So they both have strengths and weaknesses, so there is never a 'this is always the best one to use in all scenarios'. You can mitigate a Text weaknesses, for example, by generating all of the Text textures up front, avoiding the slowness of generating them as they're being rendered for the first time. It uses more memory, but maybe that's an acceptable trade off? Or have some fancy code so that if you have the same word and style in 2 places, you don't have 2 Text objects with their own textures, but they share the 1 texture? Or use textures from Text to create a dynamic atlas, which pixi-ui uses I believe. a rapidly updating high score object might rule out normal Text because the rapidly regeneration of the texture may cause performance issues. Or maybe not. Profile your own use case xerver 1 Quote Link to comment Share on other sites More sharing options...
botmaster Posted January 10, 2019 Share Posted January 10, 2019 If your current view needs as much memory/perf as possible then all normal texts displayed anywhere in that view will take away some of that memory/perf and it actually does add up quick. In that case you want to use bitmaptext instead and it will save you memory/perf for your view. If the current view doesn't need extensive memory/perf then use normal text (but keep the amount reasonable, eg. less than 10) RussiSunni 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.