2011-06-14 14:31:25 +08:00
|
|
|
|
2012-09-17 14:40:42 +08:00
|
|
|
enum {
|
|
|
|
kCCLabelAutomaticWidth = -1,
|
|
|
|
};
|
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
class CCLabelBMFont : public CCSpriteBatchNode
|
2012-02-02 14:26:38 +08:00
|
|
|
{
|
2013-03-29 20:35:38 +08:00
|
|
|
CCLabelBMFont();
|
|
|
|
~CCLabelBMFont();
|
|
|
|
bool init();
|
2012-02-02 14:26:38 +08:00
|
|
|
void setString(const char *label);
|
2012-08-10 18:14:04 +08:00
|
|
|
void setString(const char *label, bool fromUpdate);
|
|
|
|
void setCString(const char *label);
|
2013-07-04 12:50:17 +08:00
|
|
|
const char* getString(void) const;
|
2012-08-10 18:14:04 +08:00
|
|
|
|
|
|
|
void setAnchorPoint(const CCPoint & var);
|
|
|
|
void setAlignment(CCTextAlignment alignment);
|
|
|
|
void setWidth(float width);
|
|
|
|
void setLineBreakWithoutSpace(bool breakWithoutSpace);
|
|
|
|
void setScale(float scale);
|
|
|
|
void setScaleX(float scaleX);
|
|
|
|
void setScaleY(float scaleY);
|
|
|
|
|
|
|
|
void setFntFile(const char* fntFile);
|
|
|
|
const char* getFntFile();
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2013-07-08 11:34:31 +08:00
|
|
|
void setColor(const Color3B& color);
|
|
|
|
const Color3B& getColor(void) const;
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2013-07-04 12:50:17 +08:00
|
|
|
GLubyte getOpacity(void) const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setOpacity(GLubyte opacity);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2013-07-04 12:50:17 +08:00
|
|
|
bool isOpacityModifyRGB() const;
|
2012-08-10 18:14:04 +08:00
|
|
|
void setOpacityModifyRGB(bool isOpacityModifyRGB);
|
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
static void purgeCachedData();
|
2012-09-17 14:40:42 +08:00
|
|
|
static CCLabelBMFont * create(const char *str, const char *fntFile, float width = kCCLabelAutomaticWidth, CCTextAlignment alignment = kCCTextAlignmentLeft, CCPoint imageOffset = CCPointMake(0, 0));
|
2012-08-10 18:14:04 +08:00
|
|
|
static CCLabelBMFont * create();
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|