Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by AutoDMC

So I've generated a font based on the Apple Butter font from the Cumberland Font works, at 64 pixels tall. My game is set to run at 640x480. You can see the font here: /><br />
<br />
So, by hand, I painted the font spacings under the letters.  Bleh.  In any case, taking the main.js in the default installation of impactjs, I made a couple of changes:<br />
<br />
1) I added appleButter-64.font.png to impactjs/media<br />
2) I changed the font: line to read:  font: new ig.Font( 'media/appleButter-64.font.png' ),<br />
<br />
No other changes were made.  I expected the text to appear off center, etc, because I didn't change the layout.<br />
<br />
However, I see the loading screen, it takes a second to load, and then...<br />
<br />
blank screen.<br />
<br />
I changed the font line back to use the 04b03.font.png, and it works again.  So what am I doing wrong here?			</div>
		</div>
			<div class=

1 decade ago by Hareesun

If you can throw a mini-instance of this online, I can take a look for you? :)

I guess it could be that you haven't actually finished the font image? There's a whole lowercase and some other characters left. :)

1 decade ago by dominic

Your font image is fine and the font - in fact - works. However, you have to be careful to only use those letters that are present in your font image. So for this font you can only use uppercase letters. E.g.:

font.draw( 'TEST', x, y ); // This works
font.draw( 'test', x, y ); // This doesn't

// You can also use the .toUpperCase() method, to make sure 
// you only draw upper case letters:
font.draw( 'test'.toUpperCase(), x, y );

1 decade ago by AutoDMC

Boy, is my face red. Thanks, both of you. The lack of small letters was intended.

Wow, I hope this at least helps somebody else so I can feel like it's not completely silly :)
Page 1 of 1
« first « previous next › last »