5 #define GL_CONTENT_SCALE_FACTOR() 1 11 enum class GlyphCollection {
20 static void bindTexture2D(GLuint textureId);
21 static void bindTexture2DN(GLuint textureUnit, GLuint textureId);
23 static void deleteTexture(GLuint textureId);
25 static void deleteProgram(GLuint program);
26 static void useProgram(GLuint program);
27 static void bindVAO(GLuint vaoId);
28 static void enableVertexAttribs(uint32_t flags);
33 std::string fontFilePath;
36 GlyphCollection glyphs;
37 const char *customGlyphs;
39 bool distanceFieldEnabled;
47 _ttfConfig(
const std::string& filePath =
"",
float size = 12,
const GlyphCollection& glyphCollection = GlyphCollection::DYNAMIC,
48 const char *customGlyphCollection =
nullptr,
bool useDistanceField =
false,
int outline = 0,
49 bool useItalics =
false,
bool useBold =
false,
bool useUnderline =
false,
bool useStrikethrough =
false)
50 : fontFilePath(filePath)
52 , glyphs(glyphCollection)
53 , customGlyphs(customGlyphCollection)
54 , distanceFieldEnabled(useDistanceField)
55 , outlineSize(outline)
58 , underline(useUnderline)
59 , strikethrough(useStrikethrough)
63 distanceFieldEnabled =
false;
70 unsigned short letteCharUTF16;
94 Color3B(GLubyte _r, GLubyte _g, GLubyte _b);
98 bool operator==(
const Color3B& right)
const;
99 bool operator==(
const Color4B& right)
const;
100 bool operator==(
const Color4F& right)
const;
101 bool operator!=(
const Color3B& right)
const;
102 bool operator!=(
const Color4B& right)
const;
103 bool operator!=(
const Color4F& right)
const;
107 return (*
this == other);
131 Color4B(GLubyte _r, GLubyte _g, GLubyte _b, GLubyte _a);
135 bool operator==(
const Color4B& right)
const;
136 bool operator==(
const Color3B& right)
const;
137 bool operator==(
const Color4F& right)
const;
138 bool operator!=(
const Color4B& right)
const;
139 bool operator!=(
const Color3B& right)
const;
140 bool operator!=(
const Color4F& right)
const;
165 Color4F(
float _r,
float _g,
float _b,
float _a);
169 bool operator==(
const Color4F& right)
const;
170 bool operator==(
const Color3B& right)
const;
171 bool operator==(
const Color4B& right)
const;
172 bool operator!=(
const Color4F& right)
const;
173 bool operator!=(
const Color3B& right)
const;
174 bool operator!=(
const Color4B& right)
const;
178 return (*
this == other);
223 Size(
float width,
float height);
226 bool equals(
const Size& v)
const;
232 static const Size ZERO;
255 CCRect(
float x,
float y,
float width,
float height);
277 void setRect(
float x,
float y,
float width,
float height);
282 float getMinX()
const;
287 float getMidX()
const;
292 float getMaxX()
const;
297 float getMinY()
const;
302 float getMidY()
const;
307 float getMaxY()
const;
312 bool equals(
const CCRect& rect)
const;
317 bool containsPoint(
const CCVector2& point)
const;
322 bool intersectsRect(
const CCRect& rect)
const;
327 bool intersectsCircle(
const CCVector2& center,
float radius)
const;
335 void merge(
const CCRect& rect);
RGB color composed of bytes 3 bytes.
Definition: GLType.h:91
static const CCRect ZERO
An empty Rect.
Definition: GLType.h:337
different physics engine has different winding order.
Definition: EventBinding.h:32
CCVector2 origin
Low left point of rect.
Definition: GLType.h:241
RGBA color composed of 4 floats.
Definition: GLType.h:162
RGBA color composed of 4 bytes.
Definition: GLType.h:128
static const Color3B WHITE
Color constants.
Definition: GLType.h:114
Size size
Width and height of the rect.
Definition: GLType.h:243