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 BFresh

Just wanted to share Google's Web Fonts for those of you that might be using HTML5's .filltext for text instead of the pixel-based fonts provided by ImpactJS (I go back and forth for some reason...) You can reference font files from the web to give your browser the ability to display more then the usual Arial, etc inside your game, was real easy to use.

http://www.google.com/webfonts

1 decade ago by fugufish

maybe write up a simple example of using it as an in-game font?

1 decade ago by BFresh

Sure thing!

1) Look up the Font you want in Google's directory, click 'Use This Font' and copy the link reference for the font.

2) In your game's HTML file, such as index.html, paste the link reference in your <head> section. I used Ubuntu's font:

<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css'>

3) From your game or CSS or anywhere really, reference that font (Ubuntu) with your text:

ig.system.context.font = 'bold 12px Ubuntu';
ig.system.context.fillStyle = '#000000';
ig.system.context.fillText( "HELLO!", x, y );

1 decade ago by triptych

Is there an impactjs wiki? This should definitely go in it...
Page 1 of 1
« first « previous next › last »