SpriteFont (v0.99.5RC) - new update, small bugfixes

This forum is currently in read-only mode.
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • What did you mean by:

    "no, shouldn't be bad

    that's how scrolling works"?

    thats how scrolling works in the plugin. it destroys and creates every time it moves.

    i'll have a look into changing this, and see how much i'll have to change. i did the destruction/recreation thing when i first started the project, before i knew anything about object picking and how easily and efficiently i could store pointers to each sprite created, which it does now for other purposes, like "for each letter", and "pick current word" picking. i'll try to redo this aspect. i'm a little wary though, because these original poor design choices are deeply embedded in thw word wrap code, which is fairly complex.

    now that its storing pointers though, it doesnt make sense to destroy and create every frame. but yeah, construct seems to have no trouble destroying and recreating a few hundred or even a thousand objects each tick

    > what was that now?

    > like multiple instance of one spritefont object

    > and if the second one shows text, the first one stops showing text?

    >

    This one's the problem.

    i think i have an idea why it's doing this.

    should be an easy fix if i'm correct. i'll have a look. expect a fix in the next day or so.

  • I'd definitely change that, seems unneccesary. If you're storing pointers to all the letters then you can just move them and update their position.

  • After using the plugin a bit I have a suggestion, I don't know how hard it would be to implement, tho.

    At the moment all sprites are aligned by the top. Is there any way to make them aligned by their hotspot instead? It's a lot faster and easier to move hotspots than it is to resize the canvas and move the images.

  • Hi everyone.

    I'll be using SpriteFont for my game, but was holding off on implimentation until it was safe to put it in. Last I know there rwas a warning that the current version might not be compatible with the eventual final version. Is that still the case or is it safe for me to begin using it in my game?

    thanks

  • After using the plugin a bit I have a suggestion, I don't know how hard it would be to implement, tho.

    At the moment all sprites are aligned by the top. Is there any way to make them aligned by their hotspot instead? It's a lot faster and easier to move hotspots than it is to resize the canvas and move the images.

    there is a set "y-offset" command that allows you to choose how up or down a letter is placed. i could also add a "automatically set y offsets to hotspot function." there was a reason i chose to ignore the hotspot initially, though i cant remember at the moment:), it wasnt for no reason.

    Hi everyone.

    I'll be using SpriteFont for my game, but was holding off on implimentation until it was safe to put it in. Last I know there rwas a warning that the current version might not be compatible with the eventual final version. Is that still the case or is it safe for me to begin using it in my game?

    thanks

    you can begin using it and be safe. all the main features have been implemented, and a have a decent understanding of how upgrading affects caps made with older versions now.

  • i could also add a "automatically set y offsets to hotspot function.

    That would be awesome. It would be a bit time consuming to set the offset for each letter.

  • awesome! Thanks.

  • I'm using a global SpriteFont, and a global sprite for it.

    The SpriteFont becomes invisible/disappears if I do like so:

    HUDSfontEnergy Choose Sprite FontAshy

    HUDSfontEnergy Set Characters by String "0123456789/E" to start at frame 1

    HUDSfontEnergy Choose Sprite FontAshy

    HUDSfontEnergy Set Characters by String "0123456789/E" to start at frame 1

    which I tried only because I was originally doing

    HUDSfontEnergy Choose Sprite FontAshy

    HUDSfontEnergy Set Characters by String "0123456789/E" to start at frame 1

    at the start of every layout in my game. It was becoming invisible after changing layout.

    So I changed it to only be initialized once.

    Other than that, it works great. Thank you for making this.

    Edit:

    I was using 6x10 pixels for all the letters, except for one which had different dimensions. I think it was 11x10. Anyways, it was causing my .cap to crash (on exit) when I used that letter. Removed it, and no more crashes.

  • I'll be using SpriteFont for my game,

    you still making that really nice game you posted ages ago?

  • I'm heavily into my other deal right now, so I'll be addressing all these one at a time, in order, first

    Creating multiple of the same SpriteFont and they aren't Always set to a text still makes old ones stop showing text.

    k konjak, this may have been a picking issue in your cap

    I suppose the best method to separate each one would be private variables

    here's a cap to demonstrate multiple instances not canceling eachother out

    left click the mouse to set one fontsprite

    right click to set the other

    http://dl.getdropbox.com/u/1013446/spritefont/notclearingtext.cap

  • > i could also add a "automatically set y offsets to hotspot function.

    >

    That would be awesome. It would be a bit time consuming to set the offset for each letter.

    ok, done

    redownload

    it's under the Set YOffset

    there's an option to set to the hotspot now

    I'm using a global SpriteFont, and a global sprite for it.

    The SpriteFont becomes invisible/disappears if I do like so:...Removed it, and no more crashes.

    I'm a little confused as to what you meant in the first part

    as for the second part, if possible pm me a link to the still crashing cap

    I'd definitely change [Scrolling Destroying/recreating Sprites], seems unneccesary. If you're storing pointers to all the letters then you can just move them and update their position.

    OK this is fixed

    with one exception

    when Confine Text To Box is on, it destroys and recreates the sprites

    this is because it chooses whether to create them in the first place based on whether they are going to be in the bounding box or not.

    [programmer talk]I think removing and adding pointers from the center of the vector along with destroying and creating certain objects might have been just as inefficient anyway. plus, it would have involved a significant amount of rewriting stuff I'm just not up to at this point in my other project[/programmer talk]

  • > I'm using a global SpriteFont, and a global sprite for it.

    >

    > The SpriteFont becomes invisible/disappears if I do like so:...Removed it, and no more crashes.

    >

    I'm a little confused as to what you meant in the first part

    as for the second part, if possible pm me a link to the still crashing cap

    I apologize. I get the feeling I've been saying things unclearly, a lot, lately.

    My SpriteFont object is set global, and the sprite it gets its characters from is also set global. It does not matter, though.

    In any case, it wasn't the differently sized frames in the sprite.

    I can crash a new cap on start with this event:

    System: 1Start of layout

    SpriteFont Choose Sprite Sprite 0

    SpriteFont Set Characters by String "01" to start at frame 1

    SpriteFont Choose Sprite Sprite 0

    SpriteFont Set Characters by String "01" to start at frame 1

    SpriteFont Show Text "01"

    Both frames of the Sprite are 6x10.

    It's just the duplicate "Choose Sprite" and "Set characters by string" doing it.

    Here is the cap: http://dl.getdropbox.com/u/1712024/ashy ... _crash.cap

    Edit: I unchecked Global on both the sprite and spritefont, and it still crashes. So it's just the duplicate choose sprite/set characters. As long as a "Show Text" action is done afterward.

  • k ashy

    I looked into this for a long time

    and honestly

    it doesn't make any sense why it's not working

    one thing I realized however,

    is that it doesn't happen if you set characters by range, instead of by string

    I apologize for the inconvenience

    but this is a weird problem that will require lots of debugging and maybe a conversation with the devs

    in other words...it could take a while.

    as I said though...works fine if you don't use set character by string

    also, I tried making the object global, and changing layouts, and you don't have to set it again on the next layout

    it works as is.

  • Yeah, I found the characters don't need to be set again when the SpriteFont and Sprite are global. It's just that I accidentally was doing that, since I had it in a "start of layout" event, which is how I ran into the issue, so I thought I'd report it here.

    I sent you a PM with some crash-on-exit issues I had found, lucid. It's pretty confusing.

    I don't know if that is what you were referring to having looked into. Thank you for the suggestion on "set characters by range", though as seen below in this post, I made my game stop crashing on exit. I wrote some of this, left the forum page open, experimented, and wrote some more.

    Oh, and if you want to/need to share those caps with the developers, that's fine of course.

    Heey, nice! I was about to ask about the possibility of adding a "set opacity" option so I could make text fade out after it's written, but I see it's already quite possible.

    Like so:

    SpriteFont: On last character written

    SpriteFont: For Each Character

    ->> FontAshy Set opacity to 99

    FontAshy: FontAshy: Opacity Less than 100

    FontAshy: FontAshy: Opacity Greater than 0

    Every 50ms: FontAshy Set opacity to FontAshy.Opacity - 1

    Ooh, hey, I just stopped my game cap from crashing on exit!

    I did it by adding this event:

    System: End of application

    HUDMessageSF Clear text

    HUDMessageSF Set Characters by String "" to start at frame 1

    HUDSfontAir Clear text

    HUDSfontAir Set Characters by String "" to start at frame 1

    HUDSfontEnergy Clear text

    HUDSfontEnergy Set Characters by String "" to start at frame 1

    HUDSfontJump Clear text

    HUDSfontJump Set Characters by String "" to start at frame 1

    HUDSfontKeys Clear text

    HUDSfontKeys Set Characters by String "" to start at frame 1

    Those are all of my SpriteFont objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks ashy

    I was noticing crashing on exits, too

    there's probably a way to fix it, now that I know it works if you clear and unset text

    so yeah, thanks, that was very helpful

    btw, the last post in this thread shows a few tricks you might find useful:

    http://www.scirra.com/phpBB3/viewtopic.php?f=3&t=4396&start=10

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