Will SpriteFont display number displays for me?

New releases and general discussions.

Post » Sun Jun 13, 2010 11:55 pm

Hi guys.

My main project requires several number displays on the screen, as well as an LCD display for messages.

I've created a custom LCD display with scrolling alpha-numerical characters, and I'm very pleased with it.

I've now moved on to the several number displays that I need, and although I've got a few ways I could do this, I'm wondering if the SpriteFont plugin would save me some time.

So first off, is it stable?
I can't remember if it was ever finished (I don't think it's in the "finished plugin" section of the forums).

Also, will it take values like a score and display it with the correct amount of sprites?
Will it also trim numerical characters that aren't needed, like preceding zeros.
In other words, if I want a 4 character display for the score, will it take a numerical value like 380 and display it with the custom font, right justified, and with the option of keeping the preceding zero?

I'm going to have a play around with the plugin now in a blank cap, so by the time you read this, I may already have my answers, but please don't let that stop you sharing anything you know.
I may not have all my answers, and it will be useful reading for anyone who searches the forum in the future.

Thanks guys,
Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Mon Jun 14, 2010 12:07 am

I would [u:2xy8qsyh]not[/u:2xy8qsyh] consider it complete or stable
and fixing it would require a complete rewrite as I was a complete newb when I wrote it, and as of now I do not plan to complete it in the near future. Also, since fixing it would require rewriting it, the new version would not be compatible with this one.
what's strange is one of the reasons I couldn't fix it was because people were sending me caps with problems, but on my pc the caps ran fine.

may be pointless, but to answer your question though, it has no functions to trim leading zeros and such, I believe there is a [url=https://sourceforge.net/apps/mediawiki/construct/index.php?title=System_Expressions:2xy8qsyh]system expression[/url:2xy8qsyh] that does. However, it does have a complete set of formatting functions like word wrap, right justified, etc.

I believe someone created either an event based or python based implementation of spritefonts you might be able to find searching the forums.

Also, I don't think it's unstable in general, but everyone used the spritefont in different ways, some people made multiple instances of one spritefont object, some people made multiple objects with one instance of each. Some people initialized them each time they switched layouts. Some people made them global objects and initialized them once. I believe there is almost definitely a working way to implement spritefonts that will work on everyone's pc, as you noticed no one ever complained of disappearing letters in the example caps. I just doubt you want your major project to be the guinea pig to figure out how.

I once again repeat my apology to anyone who was counting on a finished version. It's just really infeasible with my new schedule and workload.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Jun 14, 2010 12:23 am

Thanks for the honest answer Lucid.
I'll get to work on my custom version, so it's no problem.

It's a shame though.
This is the sort of thing that Construct should have out-of-the-box.

Maybe if they ever get to Construct 1.0 they'll have included it by then.

Thanks again,
Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062

Post » Mon Jun 14, 2010 3:19 pm

Since its just numbers couldn't you just make up your own events using one sprite and 10 different frames?
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Jun 14, 2010 6:37 pm

[quote="newt":20uuhebt]Since its just numbers couldn't you just make up your own events using one sprite and 10 different frames?[/quote:20uuhebt]
Yeah, I did something similar after I posted last night.

But instead of using frames, I used directions 0-9 (and direction 10 for the blank one to use for preceding zeros), loaded the values into TextManipulator, and used each digit value to set the angle of specific instances of the sprite.

So I now have my fully working LCD display for text and numbers, and 5 numerical displays, all working fine.
It only took me an hour last night to get them finished, and I've managed to use my spare time today on graphics, so that was a bonus. :)

Krush.
B
2
S
2
G
3
Posts: 406
Reputation: 2,062


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest