-
Notifications
You must be signed in to change notification settings - Fork 0
/
LabelUtil.h
35 lines (26 loc) · 1.6 KB
/
LabelUtil.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef LABELUTIL_H_
#define LABELUTIL_H_
#include "cocos2d.h"
#include <string>
namespace dxco {
class LabelUtil {
public:
static cocos2d::CCLabelTTF* create(std::string text, int fontSize, int x, int y, int vertical, int horizontal);
static cocos2d::CCLabelTTF* create(std::string text, int fontSize, int x, int y, int vertical, int horizontal, std::string font);
static cocos2d::CCLabelTTF* create(std::string text, int fontSize, int x, int y, int vertical, int horizontal, cocos2d::CCSprite* sprite);
static cocos2d::CCLabelTTF* create(std::string text, int fontSize, int x, int y, int vertical, int horizontal, float width, float height, cocos2d::CCPoint origin);
static cocos2d::CCLabelTTF* create(std::string text, int fontSize, int x, int y, int vertical, int horizontal, float width, float height, cocos2d::CCPoint origin, std::string font);
static void setColor(cocos2d::CCLabelTTF* label, int color);
static void move(cocos2d::CCLabelTTF* label, float deltaX, float deltaY);
static void moveTo(cocos2d::CCLabelTTF* label, float x, float y);
static void moveToAbsolute(cocos2d::CCLabelTTF* label, float x, float y);
static float getWidth(cocos2d::CCLabelTTF* label);
static float getHeight(cocos2d::CCLabelTTF* label);
static void setScaleByWidth(cocos2d::CCLabelTTF* label, float width);
static void setScaleByHeight(cocos2d::CCLabelTTF* label, float height);
static float getXMiddle(cocos2d::CCLabelTTF* label);
enum position {RIGHT, LEFT, BOTTOM, TOP, MIDDLE};
enum color {WHITE, BLACK, BLUE, GREEN, RED, GREY, BROWN, PINK, PURPLE, YELLOW, GOLD};
};
} /* namespace dxco */
#endif /* LABELUTIL_H_ */