Mipey's Recent Forum Activity

  • <font size="6"><font color=red>Major update!</font></font>

    As promised, I have rewritten the Sprite Font plugin. Now it contains all ACEs of the Text object and a few more!

    I consider this release to be beta release, however it is (almmost fully) functional. Please see the provided capx example project to see how to use the plugin.

    A few shortcomings so far:

    • no layout preview (all you get is green bounding box, sorry. Will try to get it to work.)
    • no mini icon (can't figure this out...)
    • lacks text alignment options (left, right, center) - will implement soon.

    Please let me know if you find any bugs.

    Enjoy! <img src="smileys/smiley1.gif" border="0" align="middle" />

  • You may want to share the fix, so that it can be added for those who may encounter the same issue.

    If you really fixed the issue, other vista users may be grateful <img src="smileys/smiley1.gif" border="0" align="middle" />

  • ATI Mobility Radeon HD3470 is one odd horse... only laptop manufacturers can provide drivers for those, not AMD. I'm afraid those don't update their drivers all that regularly... You have to get the latest drivers for your laptop from its manufacturer.

    Well, what you can try is uninstall Construct 2 completely (be sure to backup any custom plugins and your license file if you bought C2), clean the registry of Construct 2 entries (in Software/Scirra key) and then attempt a fresh install of the latest version.

    If that doesn't work, try with an older version of Construct 2 (r64 or older).

  • RoundedX = round( MouseX / GridX ) * GridX

    Basically, first you divide the mouse X position by that even number, then you multiply it by that even number.

    In some cases you may want to use floor or ceil instead of round (for rounding up or down).

  • Okay, I'm in process of rewriting the plugin, the next update will totally break the existing implementation, but will be totally awesome! Well, kind of. Totally.

    The functionality will be pretty much the same as that of Text Object (with some extras, of course).

    Just a heads up.

  • Do I mind? DO I MIND?! <img src="smileys/smiley7.gif" border="0" align="middle" />

    Nah, not really. <img src="smileys/smiley17.gif" border="0" align="middle" /> Good work!

  • <font color="red"><font size="4">NOTICE: This plugin is no longer being worked on.</font></font>

    Unfortunately I do not have expertise nor time to continue developing this plugin. Feel free to pick it up or develop your own.

    <font size="6">Sprite Font</font>

    Display text using a bitmap font.

    <font size="4">Download spritefont v8.zip</font><font size="2"><font color="red"> (Revision: 28th August 2012)</font></font>

    Extract the contents into Construct 2\exporters\html5\plugins

    Older releases:

    Spritefont v7 31th July 2012

    Spritefont v6 7th May 2012 release

    Download the example capx project showcasing Sprite Font

    Another example featuring two fonts

    <font size="3">Features</font>

    • load a font strip (an image containing series of characters)
    • monospaced font (Sprite Font splits the image into tiles of equal width)
    • instanced (you can have as many instances of the Sprite Font object that share the same font strip, but display different text at different locations)
    • once you add the Sprite Font object in editor, you will be prompted to load an image, the font strip.
    • once you've added the font strip, edit the Character Set property by entering a string of character that correspond to the letters in font strip.
    • be sure to enter proper Character width and Character height values as well (think of them as tiles of the tileset)
    • box width and box height represent the size of a text box containing the text (basically a grid). May change the wording later to avoid confusion.
    • WebGL support
    • "Force Point Sampling" property to force point sampling of text in WebGL rendering mode

    <font size="3">Actions</font>

    Set text (text) - Sets the text to be displayed.

    Append text (text) - Adds the text at end of existing text.

    Set word wrapping method (None, Break, By word) - Choose the text wrapping method: None, Break (wraps text into new line), By word (try to keep whole words; any words longer than 10 will be broken regardless)

    Set Resize Mode (None, Limited width, Limited height, Fixed size) - Determines how the bounding box is resized. None: don't resize automatically, Limited width: wrap at given width, unlimited lines; Limited height: limit number of lines, unlimited width; Fixed size: hard limit, only show text inside within given size)

    Set text scale(float) - Set the font size, e.g. 2 for double size, 0.5 for half size)

    Set text parameters - Set several parameters of the selected sprite font objects (text, text wrapping, resize mode, line length limit, line count limit, scale)

    Set text align (Left,Center,Right | Top,Middle,Bottom) - Sets the text alignment.

    Toggle debug - toggles debug mode (shows outline around text at the moment)

    Set horizontal spacing(pixels) - spacing between letters, can be negative

    Set vertical spacing(pixels) - spacing between lines, can be negative

    Set Effect(effect) - Set blending mode (effect)

    <font size="3">Conditions</font>

    Deprecated until I fix picking problem

    <font size="3">Expressions</font>

    charHeight - returns height of individual character

    charWidth - returns width of individual character

    getResizeMode - returns current resize mode

    getResizeWidth - returns current line length limit

    getResizeHeight - returns current line count limit

    getScale - returns current scale

    text - returns current text

    getHorizontalAlign - returns current text horizontal alignment

    getVerticalAlign - returns current text vertical alignment

    getHorizontalSpacing

    getVerticalSpacing

    <font color="red"><font size="4">TODO:</font></font>

    • if possible, render text in edittime
    • hotspots?
    • conditions (disabled the two compare text condition, present bug)

    Please report bugs and suggest features here in this thread!

    HOW-TO: Creating a Sprite Font compatible font strip

    1. Open your text editor and type out all letters that you want to use in a straight string.

    2. Open your image editor of choice, add text, paste the string.

    3. Select font, resize as needed.

    Make sure you resize in a way you can get a whole number as text width. For example, if you have 100 characters in the string and the whole font sprit is 1200 pixels wide, each font is 1200/100 = 12 pixels wide. Get the height in pixels as well, leave a little white space, however you want.

    Finally, save the image and import it to Construct 2 (by editing Sprite Font texture). Insert the character width and height there, in charset insert that string you pasted and - voila! You're set.

    <font size="3">TIPS</font>

    1. Sprite Font can also use tilesets, not just font strips, basically anything that is a grid of images.

    2. Sprite Font object uses the same texture for all its instances. Add another Sprite Font object and you can use another font!

    3. Sprite Font behaves just like Text object. Don't like how Text object behaves? Frustrated at font woes? Create your own font strip and use the Sprite Font!

    4. Some characters may need to be escaped with \ before them in a string. To be on the safe side, stick to alphanumeric characters!

    5. Don't like how letters are placed so widely? Use horizontal spacing to get them tighter!

  • Oh, I must have confused the meaning of parameters. Sorry about that (note to self: sleep deprivation is bad).

    Anyway, I made my own plugin with case sensitive find, so this is not much of an issue anymore :)

    Though you may want to add a parameter to toggle case sensitivity.

  • Well said, though it seem that you have neglected an important criteria: the game's ability to keep the player's attention.

  • Toggle? Simple:

    + On some key pressed

    • somevariable = 1 - variable
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Allow me to be the party pooper by pointing out that something in the poll stinks.

    A certain, in my opinion pretty subpar entry had almost no votes the first day and now suddenly gained an overwhelming advantage over brilliant games.

    I wouldn't be surprised if there has been a major surge of new accounts that contributed nothing but voted. So much for "users" choice.

    This trophy will have a permanent stigma attached to it.

  • Ah, somehow missed that bit. Fair enough, thanks for prompt answer!

    I was hoping to get some kind of preview for my spritefont plugin, looks like I may have to do it the hard way.

Mipey's avatar

Mipey

Member since 16 Jan, 2009

None one is following Mipey yet!

Trophy Case

  • 15-Year Club
  • Email Verified

Progress

16/44
How to earn trophies