Tutorials – Sparrow

I tested the Sparrow framework today, and here is the result ! Just loaded the demo.xcodeproj provided with Sparrow and changed the SPTextField font name…

The good neews is that it is also working with Starling (a flash framwork)

in the demo project provided in the sparrow package:

// Bitmap fonts!
NSString *bmpFontName = [SPTextField registerBitmapFontFromFile:@"testbmglyph.fnt"];

// That’s it! If you use this font now, the textField will be rendered with the bitmap font.
SPTextField *bmpFontTF = [SPTextField textFieldWithWidth:300 height:150
text:@"your text here!"];
bmpFontTF.fontSize = SP_NATIVE_FONT_SIZE; // use the native bitmap font size, no scaling
bmpFontTF.fontName = bmpFontName;
bmpFontTF.color = SP_WHITE; // use white if you want to use the texture as it is
bmpFontTF.hAlign = SPHAlignCenter;
bmpFontTF.vAlign = SPVAlignCenter;
bmpFontTF.kerning = YES;
bmpFontTF.x = offset;
bmpFontTF.y = fontTF.y + fontTF.height + offset;
[self addChild:bmpFontTF];