Wanted to talk about some enhancements we started working on the end of last week.  The team introduced a new object called CCLabel which will use the fonts that are installed on the system.  This should make it a lot easier to get started for developers that just want to output simple text without having to load a TTF or XNB font file.

The caveat right now is that it is only available on Mac, iOS, Android, Ouya, Windows and Windows GL.  We are working on a solution for the other systems as well.

There is a new test called SystemFontTest that was made available for those systems as well.

To use this type of label you just need to create a new instance of CCLabel using one of the following constructors:

1
2
3
4
5
6
7
8
9
10
11
public CCLabel(string text, string fontName, float fontSize)
 
public CCLabel(string text, string fontName, float fontSize, CCTextAlignment hAlignment)
 
public CCLabel(string text, string fontName, float fontSize, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment)
 
public CCLabel(string text, string fontName, float fontSize, CCSize dimensions)
 
public CCLabel(string text, string fontName, float fontSize, CCSize dimensions, CCTextAlignment hAlignment)
 
public CCLabel(string text, string fontName, float fontSize, CCSize dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment)

You can then use this CCLabel just like any other label that you would create.  In each of the constructors above the fontName parameter would be a font that is installed and available on the system.  You will have to be careful here because fonts could be different from system to system and platform to platform.  For instance using “Marker Felt” as a font name may work well on iOS and Mac but on Windows you would need to use “Felt” for the same font name.  It would be best to stick with normal fonts in these cases.  For more esoteric fonts you still have the option of CCLabelTTF, CCLabelBMFont or CCLabelAtlasFont.

Please give this new CCLabel a try and let us know if it works for you.