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

Post and try out addons that are currently in development.

Post » Mon Aug 17, 2009 10:14 am

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
B
3
G
3
Posts: 83
Reputation: 1,041

Post » Mon Aug 17, 2009 10:16 am

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.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Mon Aug 17, 2009 11:49 am

[quote="Instant":1fohhgix]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[/quote:1fohhgix]
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
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 17, 2009 4:46 pm

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.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Aug 17, 2009 7:41 pm

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.

[quote="Arima":34a4to2x]Click around randomly. After about 5 clicks, the app crashes. Deleting the spritefont stops it from crashing.[/quote:34a4to2x]
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.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Mon Aug 17, 2009 8:03 pm

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.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Aug 17, 2009 8:10 pm

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


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 :
[url:2t5ru9tm]http://dl.getdropbox.com/u/1013446/arima.cap[/url:2t5ru9tm]

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
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Aug 17, 2009 9:47 pm

[quote="lucid":3dn3idbf]
1. when you left click you destroyed the fontsprite, and do not recreate it.[/quote:3dn3idbf]

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

[quote="lucid":3dn3idbf]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[/quote:3dn3idbf]

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

[quote="lucid":3dn3idbf]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"[/quote:3dn3idbf]

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

[quote="lucid":3dn3idbf]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.[/quote:3dn3idbf]

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

[quote="lucid":3dn3idbf]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[/quote:3dn3idbf]

Sweet, thanks!

Edit: Setting the sprite and character range every frame appears to have been what was causing the crash.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Aug 17, 2009 11:54 pm

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?
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Tue Aug 18, 2009 12:57 am

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.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

PreviousNext

Return to Work-in-progress addons

Who is online

Users browsing this forum: No registered users and 0 guests