[Plugin] Spritefont (28th August 2012)

0 favourites
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • After I updated spritefont plugin and restarted c2 I get this message:

    ---------------------------

    HTML5 exporter

    ---------------------------

    Unable to load plugin in 'E:\ohjelmia\Construct 2_HTML5\Construct 2\exporters\html5\plugins\plugins\': Cannot open file 'E:\ohjelmia\Construct 2_HTML5\Construct 2\exporters\html5\plugins\plugins\common.js'

    This plugin will not be available in the editor.

    ---------------------------

    OK   

    ---------------------------

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Greg - glad to hear that! Drink that beer in my name. :P

    nemo - therein lies the problem:

    'E:\ohjelmia\Construct 2_HTML5\Construct 2\exporters\html5[b]plugins\plugins[/b]common.js'

    Construct 2 editor automatically loads all folders within the exporters\html5\plugins\ as separate plugins. Somehow I doubt that additional \plugins\ folder is a plugin, so it fails! Did you accidentally duplicate the plugins folder?

    Anyhow, this is unrelated to the spritefont.

  • Greg - glad to hear that! Drink that beer in my name. :P

    nemo - therein lies the problem:

    'E:\ohjelmia\Construct 2_HTML5\Construct 2\exporters\html5[b]plugins\plugins[/b]common.js'

    Construct 2 editor automatically loads all folders within the exporters\html5\plugins\ as separate plugins. Somehow I doubt that additional \plugins\ folder is a plugin, so it fails! Did you accidentally duplicate the plugins folder?

    Anyhow, this is unrelated to the spritefont.

    That was the problem. <img src="smileys/smiley9.gif" border="0" align="middle" /> Sorry this has nothing to do with your plugin.

  • I'm having some issues with letter spacing. How do you deal with thinner letters like lowercase "l" when creating the font strip? The character width of my widest letter is 30 pixels, but the thinner letters, like lowercase "l", are significantly smaller than that so they create awkwardly spaced words inside Construct 2. Adjusting the Horizontal spacing property doesn't help because its an issue with individual letters.

  • Yeah, it's a problem with certain fonts, since spritefont is designed to be monospaced. You can place those letters yourself, place it in its tile manually wherever you want it. In the center, slightly left or right of center... your call.

  • I seem to have a problem with the spritefont objects disappearing when revisiting layouts. Mostly it just seems to happen when the spritefont object in question is scaling.

    I have some menus set up where if the mouse is highlighting an option, the text will scale up a little bit to show it's selected, and when the mouse no longer hovers above it it shrinks back down to normal. This works fine on a layout the first time, but if I leave the layout and then come back to it, upon scaling the spritefont disappears. Not sure what is causing that. It only seems to do it when revisiting a layout, not on new layouts. Very... weird.

  • Hm, couldn't reproduce the issue. I made it so the spritefont was scaled on mouseover and so I could change layouts on Enter... kept going back and forth, with or without scaling. Didn't disappear at all.

  • Hmm... I also had anchor behavior applied, and once I removed the anchor behavior from the spritefont it seemed to fix the issue. Kinda weird. I don't know if you can reproduce that, or if it's even worth looking into whether there's an incompatibility with Anchor or not.

  • Hm, SpriteFont object behavior is kind of erratic with Anchor behavior enabled. Could be because SpriteFont works out its own positioning and scaling for each glyph. I'm not sure how Anchor works, but it tries to force reposition or rescale the object, which can cause unforeseen consequences.

    However I didn't encounter any disappearances, just jarring and wonkiness. Eh, all the same.

    Guess I'll need to rewrite SpriteFont in the future, to better work with new exporters. I'll change the way it works positioning and scaling out then.

  • Is there a way to load the image used for spritefont at runtime?

    I'm working on a game and I would love to switch the fonts from level to level (not really the font, but the color and style). Since there is no frames in Spritefont, is there a way to load in a new png in the event sheet?

    Thanks for this amazing plugin. Really great.

  • ArcadEd:

    I'm not really sure how to go about loading images at will in Construct 2. I've been considering a rewrite of the plugin, so that is on the table.

    But until I figure out things like image swapping at runtime, it'll have to wait. Can't give any timetable, sorry.

  • That's ok. It would also work if you could load in frames of animations like you currently can with sprites, then just call the different frames. I don't know if that is possible either :).

    Thanks.

  • This currently doesn't work with CocoonJS. Just wanted to mention it. I think this is a very powerful plugin as it allows us to create our own fonts to make the games look good, without the need to include fonts/css file and hope the browser they are playing on supports it.

    By doesn't work, I mean the text doesn't show up when testing with the CocoonJS launcher on my phone. Just see blank white boxes.

  • Sprite based fonts is the best option for fonts imo. Don't like Web Fonts at all due to several reasons. Don't think mixing web rendering in a game is a good idea since things can and probably will appear and even behave differently from implementation to implementation. Sprite fonts is the way to go. Proof of this is that pretty much every engine uses them even other HTML5 ones. The problem is the generating of the font sheet. It could be generated by C2 itself or by an external tool like Glyph Designer on Mac, BMFont on Windows etc.

    So best wishes for this plugin :D

  • ArcadEd: I am aware of the issue, but I'm not sure what is causing it. Another reason for the plugin rewrite, as it's been a while since I've touched the code. I already have a few ideas how to refactor it for usage, performance and compatibility.

    kiyoshi: That was a reason I got down to make Spritefont. It may not be the most elegant to handle, but at least it works, so I don't have to pull my hair with web fonts anymore!

    If only I could figure out why it won't play nice with CocoonJS... Some archaic black magic they didn't add support for, perhaps?

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