Skip to content

Instantly share code, notes, and snippets.

@Draknek
Created June 2, 2011 08:12
Show Gist options
  • Save Draknek/1004100 to your computer and use it in GitHub Desktop.
Save Draknek/1004100 to your computer and use it in GitHub Desktop.
Font size test
package
{
import net.flashpunk.*;
import net.flashpunk.graphics.*;
import flash.net.*;
import flash.display.*;
[SWF(width = "800", height = "640", backgroundColor="#000000")]
public class Main extends Engine
{
[Embed(source = 'CHANGE THIS.ttf', embedAsCFF="false", fontFamily = 'test')]
public static const FONT:Class;
public function Main ()
{
Text.font = "test";
super(800, 640, 60, true);
FP.screen.scale = 2;
var y:int = 2;
for (var i:int = 2; i < 30; i++) {
var t:Text = new Text(i + " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", 2, y, {size: i});
y+= i;
FP.world.addGraphic(t);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment