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

Post and try out addons that are currently in development.

Post » Wed Aug 12, 2009 4:11 pm

[quote="lucid":3domuo4h]i could also add a "automatically set y offsets to hotspot function.[/quote:3domuo4h]

That would be awesome. It would be a bit time consuming to set the offset for each letter.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Wed Aug 12, 2009 4:15 pm

awesome! Thanks. :)
B
2
S
2
G
4
Posts: 124
Reputation: 1,698

Post » Sat Aug 15, 2009 8:19 am

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

Post » Sat Aug 15, 2009 2:04 pm

[quote="Holymonkey":3f39lsbx]
I'll be using SpriteFont for my game, [/quote:3f39lsbx]

you still making that really nice game you posted ages ago? :o
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Sun Aug 16, 2009 12:49 am

I'm heavily into my other deal right now, so I'll be addressing all these one at a time, in order, first
[quote="konjak":1apk9dhh]Creating multiple of the same SpriteFont and they aren't Always set to a text still makes old ones stop showing text.[/quote:1apk9dhh]

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

[url:1apk9dhh]http://dl.getdropbox.com/u/1013446/spritefont/notclearingtext.cap[/url:1apk9dhh]
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Aug 16, 2009 1:47 am

[quote="Arima":21yakre7][quote="lucid":21yakre7]i could also add a "automatically set y offsets to hotspot function.[/quote:21yakre7]

That would be awesome. It would be a bit time consuming to set the offset for each letter.[/quote:21yakre7]

ok, done
redownload

it's under the Set YOffset
there's an option to set to the hotspot now

[quote="AshyRaccoon":21yakre7]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.[/quote:21yakre7]

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

[quote="RWhilding":21yakre7]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.[/quote:21yakre7]
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. [size=80:21yakre7][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][/size:21yakre7]
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sun Aug 16, 2009 2:21 am

[quote="lucid":2ehznbiy]
[quote="AshyRaccoon":2ehznbiy]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.[/quote:2ehznbiy]

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
[/quote:2ehznbiy]
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.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Sun Aug 16, 2009 12:48 pm

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

Post » Sun Aug 16, 2009 10:46 pm

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

Post » Sun Aug 16, 2009 11:15 pm

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:
[url:2xnnqegz]http://www.scirra.com/phpBB3/viewtopic.php?f=3&t=4396&start=10[/url:2xnnqegz]
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

PreviousNext

Return to Work-in-progress addons

Who is online

Users browsing this forum: No registered users and 0 guests