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

This forum is currently in read-only mode.
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • If this writes at a speed , can there please be an output which is triggered whenever it "types" so we can have some sort of typewriter sound added in

  • A method of doing that now would be to add a Timer behavior to the object, and to start a looping timer when writing begins at the speed you set the text to write at.

  • If this writes at a speed , can there please be an output which is triggered whenever it "types" so we can have some sort of typewriter sound added in

    excellent question:)

    there are several conditions for this purpose

    there is

    "on character written", which you can choose to activate on any character or a specific character,

    "non-white space character written" which triggers when anything except return or space

    "on newline written" so you could add a separate sound of the carraige return on the typewriter as well

    "on last character written"is triggered at the end of the writing

    and "is writing" is true as long as writing has not completed

  • Thanks for the y-align feature, it works great.

    Aside from that tho, I'm getting lots of freezes and crashes while working with it. I've been having a hard time making .caps to send to you because deleting everything else out of the .cap causes it to act differently.

    Here's one: http://www.amirai.net/misc/spritetext.cap Click around randomly. After about 5 clicks, the app crashes. Deleting the spritefont stops it from crashing.

    Also, would it be possible to add debugger info? And how do you set the width of the box at runtime?

    Edit: Add the action "spritefont: set phrase position to mousex, mousey" the event 3 to get some weird behavior. It stops crashing, but now spritefonts don't get deleted upon clicking anymore and occasionally it writes "tex" instead of "text" and it looks like there are two extra letters behind the first two, and the x is misaligned a pixel.

    Edit 2: Drag the mouse quickly while clicking to see the extra two letters I mentioned.

  • Hmm. It appears that I didn't need the "Clear Text" actions to stop my cap from crashing on exit. Just using Set Characters by String "" on all my SpriteFont objects stops it from crashing.

    Click around randomly. After about 5 clicks, the app crashes. Deleting the spritefont stops it from crashing.

    For some reason it is not crashing on me. I tried clicking about 50 times, in different places in the window. I just downloaded it and tried it, and didn't change anything.

    However, I am seeing similar behavior to what you described about event 3, after adding "spritefont: set phrase position to mousex, mousey" to event 3. The old SpriteFonts aren't deleted, and it writes "tex" sometimes instead of "text". I am also seeing an extra "text" following the mouse cursor around, and where it is positioned relative to the cursor depends on where I last clicked.

  • Huh. Are you using both the latest versions of construct and the spritefont? Otherwise, I have no idea why it's not crashing for you.

    I've managed to work around that weird behavior by clearing the text then destroying them. What I'm guessing is happening is the spritefont object is getting deleted but it's not deleting the instances of letters it creates.

  • it didn't crash or freeze for me

    but I did notice a few things about your cap

    and trust me, I understand most of this is my fault for the lack of documentation

    <img src="http://dl.getdropbox.com/u/1013446/Capture14141.PNG">

    1. when you left click you destroyed the fontsprite, and do not recreate it.

    anything that happens from here on out is relying on a glitch in construct or in the fontsprite to continue.

    also you don't need to destroy the panel and remake it, you can just move it, unless you're just testing something. for the fontsprite, just clear it, it will be invisible until further notice

    2.not sure if this was your intention, but "write text" at 0 milliseconds, writes one letter per tick

    if you want the text to come instantly, just use "show text"

    3.it is not necessary (and will most likely cause problems) to set the character sprite and range repeatedly, just do it once in start of layout.

    also, I think something may be wrong with the cap, because I tried changing some things, and they wouldn't work, and I was able to make them work in a fresh cap.

    as far as setting the length and width of the object

    I guess I forgot that part

    consider it done - sometime in the next few days, I'll have an update

    but in the meantime, you can use attach to object

    which automatically always sets the fontsprite position and dimensions to another object

    unfortunately I discovered a bug just now with it

    I realized it sets the position and dimensions at the beginning of a tick, and not after a tick

    so if you don't either Show Text again after the move, or Set Phrase Position after the move

    the fontsprite will always be in the previous position.

    in the following cap, I've included both workarounds (these workarounds will not be necessary when this will be fixed in the next update)

    here's something similar to your cap, with some of the modifications I mentioned :

    http://dl.getdropbox.com/u/1013446/arima.cap

    edit: correct - it destroys the fontsprite, but does not clear the text first. it would make more sense if it did, though

    it might be useful to keep the sprites around for something, so I will make it give an option to clear text (set default to yes) on destroy.

    thanks again guys for helping me improve this

  • 1. when you left click you destroyed the fontsprite, and do not recreate it.

    I should have mentioned, the spritefont is in a container with the panel, so it gets created with the panel in event 2.

    also you don't need to destroy the panel and remake it, you can just move it, unless you're just testing something. for the fontsprite, just clear it, it will be invisible until further notice

    I'm going to be using multiple spritefont boxes, so I need to create/destroy them.

    2.not sure if this was your intention, but "write text" at 0 milliseconds, writes one letter per tick

    if you want the text to come instantly, just use "show text"

    Yeah, that's what I thought. I was experimenting with it and didn't bother cleaning up parts of it.

    also, I think something may be wrong with the cap, because I tried changing some things, and they wouldn't work, and I was able to make them work in a fresh cap.

    That was created from a fresh .cap, so I'm not sure why recreating it again would fix it.

    as far as setting the length and width of the object

    I guess I forgot that part

    consider it done - sometime in the next few days, I'll have an update

    Sweet, thanks!

    Edit: Setting the sprite and character range every frame appears to have been what was causing the crash.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When writing, if a word doesn't fit in the box anymore it jumps down a line. Would there be any way to make it know if a word isn't going to fit, and if so move it down before it starts writing it? Like, instead of creating the sprites one by one, create them all and place them, then one by one make them visible?

  • Have you tried "Absolute" rather than "Insertion"? It's one of the values in the Write Text action. I think it does what you mean.

  • edit:ashy's right, but I already typed this, so...:

    two parts to the answer

    first is, it only jumps down if you have word wrap on

    if you turn off word wrap it'll act as if the bounding box is infinite

    second, is

    you can set Write Text to 2 different settings

    "insert" writes the letters one by one

    as if it were a complete phrase

    it looks nice, and very different for centered or right aligned text

    "absolute" is what you're asking for

    this writes the letters in their final spot, this will make it wrap the words

    before it gets to the letter that causes the wrap

    the following cap demonstrates the difference between insert and absolute

    http://dl.getdropbox.com/u/1013446/absolutevsinsert.cap

    left click to see insert

    right click to see absolute

  • Wow, awesome! Thanks guys!

    I've got a weird bug now where it doesn't write sometimes. What's weird about it is if I debug it writes properly. I'll try to make a .cap.

  • Lucid this is absolutely amazing. thanks so much.

    I like to use it instead of the tiled object too, which seems broken.

  • I apologize for the lack of progress everyone

    really at an important part of my personal project though

    and I need to take advantage of some unanticipated free time while I have it

    but I promise I haven't given up on perfecting spritefont

    just give me some time

  • is there support for european characters? Do I have to set the range via a text string for that?

    Also, Is there a way to control character spacing per character based on the actual with of that frame?

    thanks

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