Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azrafe7/flashpunk-bitmapfont
BitmapFont and BitmapText classes for FlashPunk 1.7.x
https://github.com/azrafe7/flashpunk-bitmapfont
Last synced: 11 days ago
JSON representation
BitmapFont and BitmapText classes for FlashPunk 1.7.x
- Host: GitHub
- URL: https://github.com/azrafe7/flashpunk-bitmapfont
- Owner: azrafe7
- Created: 2013-11-21T22:37:47.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-24T18:39:04.000Z (about 11 years ago)
- Last Synced: 2024-11-05T13:22:51.361Z (about 2 months ago)
- Language: ActionScript
- Size: 168 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
FlashPunk-BitmapFont
====================`BitmapFont` and `BitmapText` classes for [FlashPunk](http://useflashpunk.net/) 1.7.x
Code adapted/improved for FlashPunk from [https://github.com/Beeblerox/BitmapFont](https://github.com/Beeblerox/BitmapFont).
Supports various formats of BitmapFonts:
- XML/AngelCode's (bitmap + meta data in xml file)
- Pixelizer (bitmap + list of characters supported)
- Serialized (a plain string defining the font data)
`BitmapText` exposes various properties to change the visual style of the text (color, outline, multiline, fixedWidth, shadow, align, etc.).
Ex.:```as3
...
bitmapText.outlineColor = 0xFF0000; // red outline
bitmapText.outlineColor = null; // <- disable the outline
bitmapText.setProperties({textColor: 0xFF0000, lineSpacing:5, shadowColor:0x0}); // set multiple properties at once
bitmapText.align = TextFormatAlign.RIGHT; // change alignment
...
```You can find a simple demo [here](https://dl.dropboxusercontent.com/u/32864004/dev/FPDemo/BitmapFontTest.swf)
In the demo a couple (triple?) of _free_ fonts have been used:
- [New Super Mario Font U](http://www.dafont.com/new-super-mario-font-u.font)
- [Alagard](http://www.dafont.com/alagard.font)
- [Round Font](https://github.com/johanp/Pixelizer)
Some excellent and free tools you may find useful for exporting font data from ttf:- [BMFont/AngelCode](http://www.angelcode.com/products/bmfont/)
- [Littera](http://kvazars.com/littera/)
`BitmapText` extends `Image` so you're still free to scale, rotate, etc. ( but be warned that result may be very _blurred/pixelly_ )Check `TestWorld.as` to see how to use it.
It needs more testing so if you find any bugs I'll be glad to hear it from you.