Development / My Own Stuff May 10, 2010 @ 21:28

Random Sentences

Click and then refresh for new nonsense!

Still work in progress, max number of words is 5.

Development / My Own Stuff May 5, 2010 @ 12:09

Box2DFlashAS3 Without “b2″ Prefixes

Just refactored the Box2DFlashAS3 physics engine version 2.1a, removing the b2 prefixes to improve readability.
Of course in C++ (the original language in which Erin Catto wrote Box2D) it is probably practical to have unique class names, but since in AS3 we have a classpath, there really is no need to make class names more cryptical.

Get it here: Box2DFlashAS3 2.1a_refactored

Note that I just copied the package and only changed most of the class names, this means that the provided examples do not compile, you can still use them as a reference though.

Development March 6, 2010 @ 09:16

Embedding Fonts in Flash Builder 4

Normally in as3 I would do it like this:

1
2
3
[Embed(source="fontFile.ttf", fontName="MyFontName")]
private var MyFont:Class;
public var myTextFormat:TextFormat = new TextFormat("MyFontName");

But for some reason (I currently don’t care about), in Flex 4, the text doesn’t show up. So after some searching some forums, I found the solution: add embedAsCFF=false to the Embed tag. Because a TTF font in a TextField is not a CFF? Oh well..

1
2
3
[Embed(source="fontFile.ttf", fontName="MyFontName", embedAsCFF=false)]
public var MyFontClass:Class;
public var myTextFormat:TextFormat = new TextFormat("MyFontName");

Currently Flash Builder 4 is still in development, so this could change in the future.
This is still the case in the release version.

Development March 4, 2010 @ 15:51

Simple AStar in AS3

For those looking for my astar implementation in as3, here’s the link to baseoneaslib so you can still access it. Sorry! I lost my old blog while moving to another host!