Sprite Font Spacing Data issues

0 favourites
  • 7 posts
From the Asset Store
Horror Halloween Pixel Art Sprite Font Space Data included
  • Hi! Sorry if I am bringing up a topic that has been mentioned for quite a few times already, but I am currently encountering some errors with Spacing Data. How do I get Spacing Data to override the Character Width and Height attributes?

    Furthermore, is this the correct format?

    [

    [6, "',.:;|"], [7, "l"], [8, "!()1I[]`ij"], [9, ""=\f{}"], [10, "+/02356789?ABCEFGHKLOPSTUVYZ_abcdeghknoprstuvxyz"], [11, "-4<>DJNQRXq~",], [12, "#$*@MWmw"], [13, "%&^"]

    ]

    Thank you in advance for all the help!

  • Watch out for 'escape characters'. Below from a post by blackhornet a while back.

    You have to 'escape' quotes and backslash with a backslash.

    [4, "\""]

    [5, "\\"]

    Forward-slash is fine.

    In general that looks like the right format, but really go through it pair by pair and make sure all the formatting is correct. I have found simple errors are not always flagged or obvious.

    This has the format, but doesn't mention the escape character / quote character issue.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/sprite-font

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi! Thank you so much for helping me out :)

    I have tried out what you have suggested, but the spacing data is still rather weird... like the character height and width values override the spacing data... Is it possible to resolve this? Thank you :)

  • Can you share the spritefont (png), the current spacing string you are using and the XxY dimensions of each character, so we can try to help you out further? You can easily share files online using: gofile.io/welcome (no account required.)

    I also want to make sure the png is following the below condition from the manual regarding different width spacing.

    The size of each character's cell in the sprite font image. Individual characters can be displayed with a different width using Spacing data or the Set character width action. In this case, the character should be drawn left-aligned within its cell.

  • Hi!! Here's the stuff you requested:

    Spritefont PNG: gofile.io/d/HyYRMq

    Current spacing string:

    [

    [6, "',.:;|"], [7, "l"], [8, "!()1I[]`ij"], [9, "\"=\\f{}"], [10, "+/02356789?ABCEFGHKLOPSTUVYZ_abcdeghknoprstuvxyz"], [11, "-4<>DJNQRXq~",], [12, "#$*@MWmw"], [13, "%&^"]

    ]

    I'm not very sure what you mean by X by Y though...

  • Sorry i meant character dimensions

  • Ah, I don't think this png will work as a C3 SpriteFont source as is. Each character needs to be in it's own cell with a fixed cell size (e.g. 16x16), it should be left aligned (e.g. character should be set to start on the left side.) In your example, each character has a variable cell size (width varies.)

    If the characters have a fixed cell size and are left aligned, the spacing data can be used to place the characters with the appropriate 'width' between each other, so it won't be monospaced.

    Here's Good Neighbors:

    Here's the correct style of formatting (notice the 'I'):

    You can fix it though, edit the image so each character is in a fixed sized cell, left align the character and then use spacing info to make the spacing correct.

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