Spritefont plugin (new)

0 favourites
  • 4 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • This is a spritefont plugin I roughly wrote up for a project my company is working on and now it is working as needed so I would like to share it and if anyone has any comment on the coding that I can improve on could feel free to let me know and I can improve it (Especially the rendering part).

    Here is the sample dropbox.com/s/ki4gz37nl5s7mx3/spritefont.capx.

    Here is the plugin dropbox.com/s/2i7tjhxf5g59a7a/EPICreationZ_Spritefont.zip

    Preparation of image:

    To start, you have to export the fonts with mono spacing as shown in the capx, sprite object "FontSheet".

    Afterwhich, create the spritefont plugin "EPICreationZ_Spritefont".

    In the "EPICreationZ_Spritefont" image editor, import as spritesheet. Find the fontsheet you have exported earlier and load into the editor.

    Delete all the empty frames.

    Go to the 1st frame (Which normally will be alphabet "A") and set the origin imagepoint to the base of the letter (Not the base of the image box).

    Apply the origin imagepoint to all animation frames.

    Crop all animation frame.

    *For spacing, create a new frame and set the width to the spacing width you want.

    **Origin imagepoint X is not taken into account for calculation of placement.

    ***Only the 1st animation will be used. So even if you create another animation, it will not be loaded.

    Plugin properties:

    Text: The text to show.

    Character set: The characters as in the animation frames. (If any of the frames is missing, it will cause error.)

    Scale: The size of the characters.

    Word wrap: Wrapping of words by word or character.

    Line height: The height in pixels of each line. (Normally if the origin imagepoint is set to the base, I would set line height to the height of alphabet "A")

    Vertical Spacing: The amount of space in pixel in between the lines.

    Horizontal Spacing: The amount of space in pixel between the characters.

    Horizontal Alignment: Horizontal align to Left,Center or Right.

    Vertical Alignment: Vertical align to Top or Center.

    *Color: Ignore this properties, leave it as White. (Used as a quick fix for my company project)

    Linear Sampling: Linear or point sampling.

    Hotspot: The origin of the font box.

    Debug: To show a red box if set to true.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did you notice we now ship a built-in sprite font plugin in the latest Construct 2 release?

  • I noticed. But because my previous project was using this plugin before the official spritefont came out. So if I was to change to the official spritefont, it would be quite alot to change. So was wondering if the WebGL rendering for my spritefont is done correctly.

  • Better use the official one, since you'll get more support in the long run.

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