Spritefont vs Text

0 favourites
  • 5 posts
From the Asset Store
Change delay, create new lines, "backspace" the text
  • hello constructers

    what should i go with if i'm making a game with a lot of text using animated bbcodes and all that gimmicky stuff? the text updates regularly and is always displayed on screen.

    SPRITEFONT OBJECT:

    - need a separate font and configuration for each language

    - better performance (?)

    TEXT OBJECT:

    - easy to make translations

    does it make sense to use spritefont for the sake of better performance, or in the long run it wouldn't matter in a large project?

    Tagged:

  • Hmm last I checked the spritefont object exists because it's faster than the text object, especially when updating the text every tick. Not sure if that's up to date...

    I'd suggest to make a simple test. Think about the maximum amount of text and animated bbcodes you'd realistically have in your project and just build a "worst case" scenario with tons of animations etc. See if you run into any issues with the normal text object. Because if not, I'd go with the normal text object over the spritefont.

  • Spritefont is for using a custom font from an image, either you need this or you don't...

  • There are pros and cons to either. Basically text is simpler to use and look good with high res stuff, but is visually poor when doing low res stuff. Spritefonts are drawn faster and give more control over the look of the text but take more setup and don’t scale up well for high res stuff.

    Text object

    Pros:

    * simple to use. Pick a font and any character is available.

    * since it utilizes the canvas’ text renderer characters edges will look smooth no matter the text size.

    Cons:

    * it works by the text being drawn to an image and copied to texture. So it takes up video ram and copying the image into the texture may not be the fastest.

    * text looks fuzzy when full screen scaling is set to low quality. So probably not the best for low res graphics.

    spritefont object

    Pros:

    * it works by just drawing characters as quads and using one texture. This is pretty fast with construct’s batching renderer.

    * useful for low res games since you have more artistic control over the look of characters.

    * very easy to use with monospaced fonts.

    Cons:

    * have to make a texture with all the characters you want to use.

    * the texture can be fairly large with a lot of characters since the texture atlas isn’t tightly packed.

    * you have to provide the spacing numbers if you want to use a variable width font. There are tools that help with that though.

    * scaled the text is only as detailed as the texture. So scaling up will be blurry or pixelated depending on the sampling.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Another pro for sprite fonts is consistency across platforms. I had some issues where text objects looked different on mobile and a post here somewhere suggested switching to sprite fonts which I did and it solved the problem.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)