[Plugin] Spritefont (28th August 2012)

0 favourites
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • So is it 100% working with the new CocoonJS update? Because someone said that the the game loaded but the font was displaying a black box instead of the numbers/letters.

  • I can confirm that Mipey's example files do load on my iPhone 4 using cocoonJS. So looks like this is now an option for CocoonJS (Good Job Ludei)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • labithiotis Good one! im not looking a workaround to support bitmap fonts in CocoonJS :D

  • Hi friends. All bug occurs if SpriteFont put in Family and look at it in Opera?

  • Everybody's working?

  • Tried out this plugin, like what it does except one minor thing.

    My project ( googledrive.com/host/0B7mHJO1CK--NN1hxV2IxWnM3dTA/gametest2.html ) is currently setup to use it for displaying test variables, but will also be used for generic text. Tileset is 8x8, spritefont is 8x8. Gametest2.html has an iframe set at 3x scale of the original.

    <img src="http://i.imgur.com/h3vX7oO.png" border="0" />

    The problem I'm running into here is that the scaling isn't exact at integers (x2 x3 x4 scaling) as it gets distorted a little (Some letters have 2 tall "pixels" instead of 3 tall), and the upper-right section shows 1 pixel beyond what it should for it's position. I have "Force Point Sampling" on but it doesn't do anything different.

    I tried it manually with using the "Text Scale" function as well as with the layout interger scale function, produces the same result.

    The best I was able to get it was at 1.025 text scale, but even that has incorrect scaling.

    Is there any work around for this or would I have to wait for the plugin to update.

    Edit: Figured out a work around

    SpriteFont Text boxes as big as they need to be:

    <img src="http://i.imgur.com/ChH2EwO.png" border="0" />

    Scaling issues

    Spritefont Text boses way bigger than they need to be (at least 160x144, my layout size)

    <img src="http://i.imgur.com/UaKfkUN.png" border="0" />

    No scaling issues

    For some reason the size of the SpriteFont box affects the scaling of the spritefont itself.


    After playing around with it, seems that even though it's properly scaled 1x with a larger box, I had to make the box even larger to have it properly scale it's resize. For 3x size I had to make the textbox 320x144

  • Thndr: unfortunately I am no longer maintaining the plugin, as it's gotten beyond my capabilities. I've not worked on it in quite a while, so all I can offer right now is advice.

    • try to keep at least 1 px empty space on borders within individual tiles
    • it is safe to make object size larger than what you want to display; in that case, control the displayed size via properties (e.g. fixed width)

    See if that helps.

  • Yeah, just going to go with larger objects. Doesn't really do much but clutter up the layout screen. Pretty easy to manage how much text it shows with the inherent properties.

    By 1 pixel border, do you mean if I have 8x8 tiles, try to have the letters be mostly 7x7 to have 1 px of vertical and horizontal? If so I already have that done.

  • Yeah, that should to the trick. I didn't really have such small tiles in mind when I developed the plugin, I was mostly working with larger tiles of variable sizes, but not that small, so I never noticed those issues you're having now. Sorry about that!

  • Hi Mipey!

    When will you make effects support? (Burn, Color, Darken ect)

    <img src="http://s017.radikal.ru/i421/1303/69/6aaf1f086693.jpg" border="0" />

  • No idea how to implement support for those.

  • where is the "Text is" event? Is it under a different name? I cannot find it. When I click on the Text is event in the example, it opens the is between angel window

  • Oh, that one has been obsoleted because of a bug I couldn't solve. It didn't pick correct instances.

    There is system compare action which does its job well, so I saw no need in doing the spritefont text compare event.

  • Hi Mipey! I have a sprite 16x16 with the figure "0". I've added this figure to Spritefont, adjusted the settings to 16x16, but I didn't get a match in the end - image is smaller in spritefont and has a distortion. Why and how can I fix it?

    my capx: dl.dropbox.com/u/36082595/c2%20temp/bug_spritefont.capx

    Construct 2 r122 beta

  • You are right, Developer, looks like my math is screwy. That's what happens when you let an amateur code a plugin! <img src="smileys/smiley5.gif" border="0" align="middle" />

    It isn't distorted if you make the spritefont object size twice as large as the individual glyph, in this case at least 32x32. So just make the spritefont object larger than you want it to display.

    One of those days I'll really have to sit down and crunch those numbers, since it appears that nobody else is willing to pick this mess up. Oh well!

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