2012-04-08 14:16:29 +08:00
|
|
|
/****************************************************************************
|
2012-09-24 21:22:20 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2012-04-08 14:16:29 +08:00
|
|
|
Copyright (c) 2008-2010 Ricardo Quesada
|
|
|
|
Copyright (c) 2011 Zynga Inc.
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __CCTYPES_H__
|
|
|
|
#define __CCTYPES_H__
|
|
|
|
|
2013-05-07 05:27:54 +08:00
|
|
|
#include <string>
|
2012-06-19 13:50:11 +08:00
|
|
|
#include "cocoa/CCGeometry.h"
|
2012-04-08 14:16:29 +08:00
|
|
|
#include "CCGL.h"
|
|
|
|
|
2013-05-07 05:27:54 +08:00
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_BEGIN
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
/** RGB color composed of bytes 3 bytes
|
2013-07-05 16:49:22 +08:00
|
|
|
@since v3.0
|
2012-04-08 14:16:29 +08:00
|
|
|
*/
|
2013-07-05 16:49:22 +08:00
|
|
|
struct Color3B
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2013-07-05 16:49:22 +08:00
|
|
|
Color3B(): r(0), g(0), b(0) {}
|
|
|
|
|
2013-07-07 21:08:14 +08:00
|
|
|
Color3B(GLubyte _r, GLubyte _g, GLubyte _b)
|
2013-07-05 16:49:22 +08:00
|
|
|
:r(_r),
|
|
|
|
g(_g),
|
|
|
|
b(_b)
|
|
|
|
{}
|
|
|
|
|
|
|
|
bool equals(const Color3B &other)
|
|
|
|
{
|
|
|
|
return (this->r == other.r &&
|
|
|
|
this->g == other.g &&
|
|
|
|
this->b == other.b);
|
|
|
|
}
|
|
|
|
|
2013-01-14 21:51:47 +08:00
|
|
|
GLubyte r;
|
|
|
|
GLubyte g;
|
2012-04-19 14:35:52 +08:00
|
|
|
GLubyte b;
|
2013-07-05 16:49:22 +08:00
|
|
|
|
|
|
|
const static Color3B white;
|
|
|
|
const static Color3B yellow;
|
|
|
|
const static Color3B blue;
|
|
|
|
const static Color3B green;
|
|
|
|
const static Color3B red;
|
|
|
|
const static Color3B magenta;
|
|
|
|
const static Color3B black;
|
|
|
|
const static Color3B orange;
|
|
|
|
const static Color3B gray;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Color4F;
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
/** RGBA color composed of 4 bytes
|
2013-07-05 16:49:22 +08:00
|
|
|
@since v3.0
|
2012-04-08 14:16:29 +08:00
|
|
|
*/
|
2013-07-05 16:49:22 +08:00
|
|
|
struct Color4B
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2013-07-07 21:08:14 +08:00
|
|
|
Color4B(GLubyte _r, GLubyte _g, GLubyte _b, GLubyte _a)
|
2013-07-05 16:49:22 +08:00
|
|
|
:r(_r),
|
|
|
|
g(_g),
|
|
|
|
b(_b),
|
|
|
|
a(_a)
|
|
|
|
{}
|
|
|
|
|
|
|
|
Color4B(): r(0.f), g(0.f), b(0.f), a(0.f) {}
|
|
|
|
|
|
|
|
// This function should use Color4F, so implement it in .cpp file.
|
2013-07-08 15:16:22 +08:00
|
|
|
explicit Color4B(const Color4F &color4F);
|
2013-07-05 16:49:22 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
GLubyte r;
|
|
|
|
GLubyte g;
|
|
|
|
GLubyte b;
|
|
|
|
GLubyte a;
|
2013-07-05 16:49:22 +08:00
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
/** RGBA color composed of 4 floats
|
2013-07-05 16:49:22 +08:00
|
|
|
@since v3.0
|
2012-04-08 14:16:29 +08:00
|
|
|
*/
|
2013-07-05 16:49:22 +08:00
|
|
|
struct Color4F
|
|
|
|
{
|
|
|
|
Color4F(float _r, float _g, float _b, float _a)
|
|
|
|
:r(_r),
|
|
|
|
g(_g),
|
|
|
|
b(_b),
|
|
|
|
a(_a)
|
|
|
|
{}
|
|
|
|
|
2013-07-08 15:16:22 +08:00
|
|
|
explicit Color4F(const Color3B &color3B)
|
2013-07-05 16:49:22 +08:00
|
|
|
:r(color3B.r)
|
|
|
|
,g(color3B.g)
|
|
|
|
,b(color3B.b)
|
|
|
|
,a(1.f)
|
|
|
|
{}
|
|
|
|
|
2013-07-08 15:16:22 +08:00
|
|
|
explicit Color4F(const Color4B &color4B)
|
2013-07-05 16:49:22 +08:00
|
|
|
:r(color4B.r / 255.0f),
|
|
|
|
g(color4B.g / 255.0f),
|
|
|
|
b(color4B.b / 255.0f),
|
|
|
|
a(color4B.a / 255.0f)
|
|
|
|
{}
|
|
|
|
|
|
|
|
Color4F(): r(0.f), g(0.f), b(0.f), a(0.f) {}
|
|
|
|
|
|
|
|
bool equals(const Color4F &other)
|
|
|
|
{
|
|
|
|
return (this->r == other.r &&
|
|
|
|
this->g == other.g &&
|
|
|
|
this->b == other.b &&
|
|
|
|
this->a == other.a);
|
|
|
|
}
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
GLfloat r;
|
|
|
|
GLfloat g;
|
|
|
|
GLfloat b;
|
|
|
|
GLfloat a;
|
2013-07-05 16:49:22 +08:00
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
/** A vertex composed of 2 floats: x, y
|
2013-07-05 16:49:22 +08:00
|
|
|
@since v3.0
|
2012-04-08 14:16:29 +08:00
|
|
|
*/
|
2013-07-05 16:49:22 +08:00
|
|
|
struct Vertex2F
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2013-07-05 16:49:22 +08:00
|
|
|
Vertex2F(float _x, float _y) :x(_x), y(_y) {}
|
|
|
|
|
|
|
|
Vertex2F(): x(0.f), y(0.f) {}
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
GLfloat x;
|
|
|
|
GLfloat y;
|
2013-07-05 16:49:22 +08:00
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
/** A vertex composed of 2 floats: x, y
|
2013-07-05 16:49:22 +08:00
|
|
|
@since v3.0
|
2012-04-08 14:16:29 +08:00
|
|
|
*/
|
2013-07-05 16:49:22 +08:00
|
|
|
struct Vertex3F
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2013-07-05 16:49:22 +08:00
|
|
|
Vertex3F(float _x, float _y, float _z)
|
|
|
|
:x(_x),
|
|
|
|
y(_y),
|
|
|
|
z(_z)
|
|
|
|
{}
|
|
|
|
|
|
|
|
Vertex3F(): x(0.f), y(0.f), z(0.f) {}
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
GLfloat x;
|
|
|
|
GLfloat y;
|
|
|
|
GLfloat z;
|
2013-07-05 16:49:22 +08:00
|
|
|
};
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-04-08 14:16:29 +08:00
|
|
|
/** A texcoord composed of 2 floats: u, y
|
2013-07-05 16:49:22 +08:00
|
|
|
@since v3.0
|
2012-04-08 14:16:29 +08:00
|
|
|
*/
|
2013-07-05 16:49:22 +08:00
|
|
|
struct Tex2F {
|
|
|
|
Tex2F(float _u, float _v): u(_u), v(_v) {}
|
|
|
|
|
|
|
|
Tex2F(): u(0.f), v(0.f) {}
|
|
|
|
|
|
|
|
GLfloat u;
|
|
|
|
GLfloat v;
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
//! Point Sprite component
|
2013-07-05 16:49:22 +08:00
|
|
|
struct PointSprite
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2013-07-05 16:49:22 +08:00
|
|
|
Vertex2F pos; // 8 bytes
|
|
|
|
Color4B color; // 4 bytes
|
|
|
|
GLfloat size; // 4 bytes
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
//! A 2D Quad. 4 * 2 floats
|
2013-07-05 16:49:22 +08:00
|
|
|
struct Quad2
|
|
|
|
{
|
|
|
|
Vertex2F tl;
|
|
|
|
Vertex2F tr;
|
|
|
|
Vertex2F bl;
|
|
|
|
Vertex2F br;
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
//! A 3D Quad. 4 * 3 floats
|
2013-07-05 16:49:22 +08:00
|
|
|
struct Quad3 {
|
|
|
|
Vertex3F bl;
|
|
|
|
Vertex3F br;
|
|
|
|
Vertex3F tl;
|
|
|
|
Vertex3F tr;
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
//! a Point with a vertex point, a tex coord point and a color 4B
|
2013-07-05 16:49:22 +08:00
|
|
|
struct V2F_C4B_T2F
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
//! vertices (2F)
|
2013-07-05 16:49:22 +08:00
|
|
|
Vertex2F vertices;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! colors (4B)
|
2013-07-05 16:49:22 +08:00
|
|
|
Color4B colors;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! tex coords (2F)
|
2013-07-05 16:49:22 +08:00
|
|
|
Tex2F texCoords;
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
//! a Point with a vertex point, a tex coord point and a color 4F
|
2013-07-05 16:49:22 +08:00
|
|
|
struct V2F_C4F_T2F
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
//! vertices (2F)
|
2013-07-05 16:49:22 +08:00
|
|
|
Vertex2F vertices;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! colors (4F)
|
2013-07-05 16:49:22 +08:00
|
|
|
Color4F colors;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! tex coords (2F)
|
2013-07-05 16:49:22 +08:00
|
|
|
Tex2F texCoords;
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
//! a Point with a vertex point, a tex coord point and a color 4B
|
2013-07-05 16:49:22 +08:00
|
|
|
struct V3F_C4B_T2F
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
//! vertices (3F)
|
2013-07-05 16:49:22 +08:00
|
|
|
Vertex3F vertices; // 12 bytes
|
2012-04-08 14:16:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
//! colors (4B)
|
2013-07-05 16:49:22 +08:00
|
|
|
Color4B colors; // 4 bytes
|
2012-04-08 14:16:29 +08:00
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
// tex coords (2F)
|
2013-07-05 16:49:22 +08:00
|
|
|
Tex2F texCoords; // 8 bytes
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
2013-07-05 16:49:22 +08:00
|
|
|
//! A Triangle of V2F_C4B_T2F
|
|
|
|
struct V2F_C4B_T2F_Triangle
|
2012-11-14 18:05:15 +08:00
|
|
|
{
|
|
|
|
//! Point A
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4B_T2F a;
|
2012-11-14 18:05:15 +08:00
|
|
|
//! Point B
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4B_T2F b;
|
2012-11-14 18:05:15 +08:00
|
|
|
//! Point B
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4B_T2F c;
|
|
|
|
};
|
2012-11-14 18:05:15 +08:00
|
|
|
|
2013-07-05 16:49:22 +08:00
|
|
|
//! A Quad of V2F_C4B_T2F
|
|
|
|
struct V2F_C4B_T2F_Quad
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
//! bottom left
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4B_T2F bl;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! bottom right
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4B_T2F br;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! top left
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4B_T2F tl;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! top right
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4B_T2F tr;
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
2013-07-05 16:49:22 +08:00
|
|
|
//! 4 Vertex3FTex2FColor4B
|
|
|
|
struct V3F_C4B_T2F_Quad
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
//! top left
|
2013-07-05 16:49:22 +08:00
|
|
|
V3F_C4B_T2F tl;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! bottom left
|
2013-07-05 16:49:22 +08:00
|
|
|
V3F_C4B_T2F bl;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! top right
|
2013-07-05 16:49:22 +08:00
|
|
|
V3F_C4B_T2F tr;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! bottom right
|
2013-07-05 16:49:22 +08:00
|
|
|
V3F_C4B_T2F br;
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
2013-07-05 16:49:22 +08:00
|
|
|
//! 4 Vertex2FTex2FColor4F Quad
|
|
|
|
struct V2F_C4F_T2F_Quad
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
//! bottom left
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4F_T2F bl;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! bottom right
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4F_T2F br;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! top left
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4F_T2F tl;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! top right
|
2013-07-05 16:49:22 +08:00
|
|
|
V2F_C4F_T2F tr;
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
//! Blend Function used for textures
|
2013-07-05 16:49:22 +08:00
|
|
|
struct BlendFunc
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
//! source blend function
|
|
|
|
GLenum src;
|
|
|
|
//! destination blend function
|
|
|
|
GLenum dst;
|
2013-07-05 16:49:22 +08:00
|
|
|
|
|
|
|
const static BlendFunc blendFuncDisable;
|
|
|
|
};
|
2012-11-14 18:05:15 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// XXX: If any of these enums are edited and/or reordered, update Texture2D.m
|
2012-06-08 14:11:48 +08:00
|
|
|
//! Vertical text alignment type
|
|
|
|
typedef enum
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
kVerticalTextAlignmentTop,
|
|
|
|
kVerticalTextAlignmentCenter,
|
|
|
|
kVerticalTextAlignmentBottom,
|
|
|
|
} VerticalTextAlignment;
|
2012-06-08 14:11:48 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// XXX: If any of these enums are edited and/or reordered, update Texture2D.m
|
2012-06-08 14:11:48 +08:00
|
|
|
//! Horizontal text alignment type
|
|
|
|
typedef enum
|
|
|
|
{
|
2013-06-20 14:13:12 +08:00
|
|
|
kTextAlignmentLeft,
|
|
|
|
kTextAlignmentCenter,
|
|
|
|
kTextAlignmentRight,
|
|
|
|
} TextAlignment;
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
// types for animation in particle systems
|
|
|
|
|
|
|
|
// texture coordinates for a quad
|
2013-07-05 16:49:22 +08:00
|
|
|
struct T2F_Quad
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2012-04-19 14:35:52 +08:00
|
|
|
//! bottom left
|
2013-07-05 16:49:22 +08:00
|
|
|
Tex2F bl;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! bottom right
|
2013-07-05 16:49:22 +08:00
|
|
|
Tex2F br;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! top left
|
2013-07-05 16:49:22 +08:00
|
|
|
Tex2F tl;
|
2012-04-19 14:35:52 +08:00
|
|
|
//! top right
|
2013-07-05 16:49:22 +08:00
|
|
|
Tex2F tr;
|
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
// struct that holds the size in pixels, texture coordinates and delays for animated ParticleSystemQuad
|
2013-07-05 16:49:22 +08:00
|
|
|
struct AnimationFrameData
|
2012-04-08 14:16:29 +08:00
|
|
|
{
|
2013-07-05 16:49:22 +08:00
|
|
|
T2F_Quad texCoords;
|
2012-06-08 13:55:28 +08:00
|
|
|
float delay;
|
2013-06-20 14:13:12 +08:00
|
|
|
Size size;
|
2013-07-05 16:49:22 +08:00
|
|
|
};
|
2012-04-08 14:16:29 +08:00
|
|
|
|
2013-05-07 05:27:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
types used for defining fonts properties (i.e. font name, size, stroke or shadow)
|
|
|
|
*/
|
|
|
|
|
|
|
|
// shadow attributes
|
2013-07-05 16:49:22 +08:00
|
|
|
struct FontShadow
|
2013-05-07 05:27:54 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// shadow is not enabled by default
|
2013-07-05 16:49:22 +08:00
|
|
|
FontShadow(): _shadowEnabled(false) {}
|
2013-05-07 05:27:54 +08:00
|
|
|
|
|
|
|
// true if shadow enabled
|
2013-06-15 14:03:30 +08:00
|
|
|
bool _shadowEnabled;
|
2013-05-07 05:27:54 +08:00
|
|
|
// shadow x and y offset
|
2013-07-05 16:49:22 +08:00
|
|
|
Size _shadowOffset;
|
2013-05-07 05:27:54 +08:00
|
|
|
// shadow blurrines
|
2013-06-15 14:03:30 +08:00
|
|
|
float _shadowBlur;
|
2013-05-07 05:27:54 +08:00
|
|
|
// shadow opacity
|
2013-06-15 14:03:30 +08:00
|
|
|
float _shadowOpacity;
|
2013-07-05 16:49:22 +08:00
|
|
|
};
|
2013-05-07 05:27:54 +08:00
|
|
|
|
|
|
|
// stroke attributes
|
2013-07-05 16:49:22 +08:00
|
|
|
struct FontStroke
|
2013-05-07 05:27:54 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// stroke is disabled by default
|
2013-07-05 16:49:22 +08:00
|
|
|
FontStroke(): _strokeEnabled(false) {}
|
2013-05-07 05:27:54 +08:00
|
|
|
|
|
|
|
// true if stroke enabled
|
2013-07-05 16:49:22 +08:00
|
|
|
bool _strokeEnabled;
|
2013-05-07 05:27:54 +08:00
|
|
|
// stroke color
|
2013-07-05 16:49:22 +08:00
|
|
|
Color3B _strokeColor;
|
2013-05-07 05:27:54 +08:00
|
|
|
// stroke size
|
2013-07-05 16:49:22 +08:00
|
|
|
float _strokeSize;
|
2013-05-07 05:27:54 +08:00
|
|
|
|
2013-07-05 16:49:22 +08:00
|
|
|
};
|
2013-05-07 05:27:54 +08:00
|
|
|
|
|
|
|
// font attributes
|
2013-07-05 16:49:22 +08:00
|
|
|
struct FontDefinition
|
2013-05-07 05:27:54 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2013-07-05 16:49:22 +08:00
|
|
|
FontDefinition(): _alignment(kTextAlignmentCenter),
|
2013-06-20 14:13:12 +08:00
|
|
|
_vertAlignment(kVerticalTextAlignmentTop),
|
2013-07-05 16:49:22 +08:00
|
|
|
_fontFillColor(Color3B::white)
|
2013-06-15 14:03:30 +08:00
|
|
|
{ _dimensions = CCSizeMake(0,0); }
|
2013-05-07 05:27:54 +08:00
|
|
|
|
|
|
|
// font name
|
2013-07-05 16:49:22 +08:00
|
|
|
std::string _fontName;
|
2013-05-07 05:27:54 +08:00
|
|
|
// font size
|
2013-07-05 16:49:22 +08:00
|
|
|
int _fontSize;
|
2013-05-07 05:27:54 +08:00
|
|
|
// horizontal alignment
|
2013-06-20 14:13:12 +08:00
|
|
|
TextAlignment _alignment;
|
2013-05-07 05:27:54 +08:00
|
|
|
// vertical alignment
|
2013-06-20 14:13:12 +08:00
|
|
|
VerticalTextAlignment _vertAlignment;
|
2013-05-07 05:27:54 +08:00
|
|
|
// renering box
|
2013-06-20 14:13:12 +08:00
|
|
|
Size _dimensions;
|
2013-05-07 05:27:54 +08:00
|
|
|
// font color
|
2013-07-05 16:49:22 +08:00
|
|
|
Color3B _fontFillColor;
|
2013-05-07 05:27:54 +08:00
|
|
|
// font shadow
|
2013-07-05 16:49:22 +08:00
|
|
|
FontShadow _shadow;
|
2013-05-07 05:27:54 +08:00
|
|
|
// font stroke
|
2013-07-05 16:49:22 +08:00
|
|
|
FontStroke _stroke;
|
2013-05-07 05:27:54 +08:00
|
|
|
|
2013-07-05 16:49:22 +08:00
|
|
|
};
|
2013-05-07 05:27:54 +08:00
|
|
|
|
|
|
|
|
2012-04-18 18:43:45 +08:00
|
|
|
NS_CC_END
|
2012-04-08 14:16:29 +08:00
|
|
|
|
|
|
|
#endif //__CCTYPES_H__
|