2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
struct _KerningHashElement;
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
typedef struct _BMFontDef {
|
|
|
|
unsigned int charID;
|
|
|
|
CCRect rect;
|
|
|
|
int xOffset;
|
|
|
|
int yOffset;
|
|
|
|
int xAdvance;
|
|
|
|
} ccBMFontDef;
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
typedef struct _BMFontPadding {
|
|
|
|
int left;
|
|
|
|
int top;
|
|
|
|
int right;
|
|
|
|
int bottom;
|
|
|
|
} ccBMFontPadding;
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
enum {
|
|
|
|
kCCBMFontMaxChars = 2048, //256,
|
|
|
|
};
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
class CCBMFontConfiguration : public CCObject
|
|
|
|
{
|
|
|
|
char * description();
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
static CCBMFontConfiguration * configurationWithFNTFile(const char *FNTfile);
|
|
|
|
};
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
class CCLabelBMFont : public CCSpriteBatchNode
|
|
|
|
{
|
|
|
|
void createFontChars();
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
void setString(const char *label);
|
|
|
|
const char* getString(void);
|
|
|
|
void setCString(const char *label);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
static void purgeCachedData();
|
|
|
|
static CCLabelBMFont * labelWithString(const char *str, const char *fntFile);
|
|
|
|
};
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
CCBMFontConfiguration * FNTConfigLoadFile(const char *file);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2011-11-09 23:23:47 +08:00
|
|
|
void FNTConfigRemoveCache(void);
|