[Plugin] Spritefont (28th August 2012)

Post your completed addons to share with the community

Post » Wed Aug 22, 2012 5:07 am

This is great Mipey.

Does anyone have a way to quickly make a font tileset/strip image? I'm using Photoshop and manually moving every character to align to a grid, and it's too tedious especially when you want to change something about the font again...alspal2012-08-22 05:08:08
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Wed Aug 22, 2012 9:17 am

I just use monospaced fonts and type them out in one long line, then cut that line up into several to stack.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Aug 22, 2012 12:18 pm

Ah ok, haven't heard that term before thanks.
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Wed Aug 22, 2012 10:12 pm

Hello, i would like to report the issue for mobile platforms.

I tested a game using your sprite font with my iPod Touch 4, the game freezes.

I exported with appMobi, i had no idea how to fix. Would you need my project files to test?

Edit: It's exported with DirectCanvasJoannesalfa2012-08-22 22:18:11
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Wed Aug 22, 2012 10:31 pm

I tested this game without DirectCanvas, it worked very well, do you think you can update your plugin to work with DirectCanvas? maybe you should to contact Ashley or appMobi devs. I'm glad to help you if you need.
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Thu Aug 23, 2012 9:59 am

Are you using C2 r100? Also, I don't have any of the mobile platforms but Android, so I can't really test the plugin there. It's more or less hit and miss for me.

Anyway, C2 r100 has introduced some rendering changes, specifically it now does effects automatically, so I probably should remove them from SpriteFont plugin and see if that helps. I'll see to it now.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Aug 23, 2012 10:42 am

Alright, I've updated SpriteFont for C2 r100. Note that effects won't work on older C2 releases, so only get Spritefont v8 if you are on C2 r100.

All I've done is remove effects from draw functions and let C2 handle them.

As for incompatibility with CocoonJS, I haven't received an answer from Ludei, though I've mailed them weeks ago, so nothing new on that front.

I'm not sure why it wouldn't work on iPhone, either. I may have to revise how SpriteFont works (specifically creating and storing images; I'm using in-memory canvas).

Maybe @Ashley can give some insight?
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sat Aug 25, 2012 6:25 am

Bug: text alignment breaks if scaling is applied. I have Text scale=2, Horz align=Center, Vert align=Middle. Doesn't center. Works if I set scaling back to 1.

r100 & v8

Thanks.
ImageImageImage
B
67
S
19
G
122
Posts: 3,206
Reputation: 73,399

Post » Sat Aug 25, 2012 8:05 am

@blackhornet, I've checked it out. Seems that when upscaled, words no longer fit the word break criteria; words that are too long get broken into two lines, since words no longer fit the width.

That's obviously undesirable, however it is a side effect of the word wrapping implementation.

Also, text centering is grid-based, not bounding box based. It attempts to center the text within the maximum allowable grid, however at large scale there tends to be a lot of wasted space at bottom, which is why vertical alignment appears to be incorrect, especially if using even number of rows. Which of the two lines is the middle one?

The alignment and wrapping methods are rather flawed, so I may have to rework them, however it is a hack job.

I'll see if I can do something, but no promises. For now, keep those limitations in the mind.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sun Aug 26, 2012 12:33 am

For anyone who's interested, I've written a small utility for generating Sprite Font files. Available here: GiveYourFontsMono(spacing)

Requires .NET 4 be installed. Usually available through Windows Update.

Just enter the character set, set the parameters, and save the file.
ImageImageImage
B
67
S
19
G
122
Posts: 3,206
Reputation: 73,399

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests