Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into cocos-console-test

This commit is contained in:
shujunqiao 2014-03-28 09:25:16 +08:00
commit ba97b6cf8a
157 changed files with 776 additions and 506 deletions

View File

@ -1 +1 @@
24725aaaf53bbf506d1ea378c6af1d9ff1e61c12
63f931258263a5cf78f2e7d478324a57ccdc9794

View File

@ -43,6 +43,7 @@ FontAtlas::FontAtlas(Font &theFont)
, _fontAscender(0)
, _toForegroundListener(nullptr)
, _toBackgroundListener(nullptr)
, _antialiasEnabled(true)
{
_font->retain();
@ -68,7 +69,12 @@ FontAtlas::FontAtlas(Font &theFont)
}
_currentPageData = new unsigned char[_currentPageDataSize];
memset(_currentPageData, 0, _currentPageDataSize);
memset(_currentPageData, 0, _currentPageDataSize);
auto pixelFormat = fontTTf->getOutlineSize() > 0 ? Texture2D::PixelFormat::AI88 : Texture2D::PixelFormat::A8;
texture->initWithData(_currentPageData, _currentPageDataSize,
pixelFormat, CacheTextureWidth, CacheTextureHeight, Size(CacheTextureWidth,CacheTextureHeight) );
addTexture(texture,0);
texture->release();
#if CC_ENABLE_CACHE_TEXTURE_DATA
@ -182,12 +188,10 @@ void FontAtlas::listenToForeground(EventCustom *event)
}
else
{
auto contentSize = Size(CacheTextureWidth,CacheTextureHeight);
auto pixelFormat = fontTTf->getOutlineSize() > 0 ? Texture2D::PixelFormat::AI88 : Texture2D::PixelFormat::A8;
// this is a memory leak as the texture previously in _atlasTextures[_currentPage] is not deleted from OpenGL
// see CCTexture2D::initWithData for the temporary fix
_atlasTextures[_currentPage]->initWithData(_currentPageData, _currentPageDataSize, pixelFormat, CacheTextureWidth, CacheTextureHeight, contentSize );
_atlasTextures[_currentPage]->initWithData(_currentPageData, _currentPageDataSize,
pixelFormat, CacheTextureWidth, CacheTextureHeight, Size(CacheTextureWidth,CacheTextureHeight) );
}
}
#endif
@ -201,7 +205,7 @@ void FontAtlas::addLetterDefinition(const FontLetterDefinition &letterDefinition
bool FontAtlas::getLetterDefinitionForChar(unsigned short letteCharUTF16, FontLetterDefinition &outDefinition)
{
auto outIterator = _fontLetterDefinitions.find(letteCharUTF16);
if (outIterator != _fontLetterDefinitions.end())
{
outDefinition = (*outIterator).second;
@ -228,12 +232,13 @@ bool FontAtlas::prepareLetterDefinitions(unsigned short *utf16String)
Rect tempRect;
FontLetterDefinition tempDef;
auto contentSize = Size(CacheTextureWidth,CacheTextureHeight);
auto scaleFactor = CC_CONTENT_SCALE_FACTOR();
auto pixelFormat = fontTTf->getOutlineSize() > 0 ? Texture2D::PixelFormat::AI88 : Texture2D::PixelFormat::A8;
bool existNewLetter = false;
int bottomHeight = _commonLineHeight - _fontAscender;
float startX = _currentPageOrigX;
float startY = _currentPageOrigY;
for (int i = 0; i < length; ++i)
{
@ -260,13 +265,26 @@ bool FontAtlas::prepareLetterDefinitions(unsigned short *utf16String)
_currentPageOrigX = 0;
if(_currentPageOrigY + _commonLineHeight >= CacheTextureHeight)
{
// this is a memory leak as the texture previously in _atlasTextures[_currentPage] is not deleted from OpenGL
// see CCTexture2D::initWithData for the temporary fix
_atlasTextures[_currentPage]->initWithData(_currentPageData, _currentPageDataSize, pixelFormat, CacheTextureWidth, CacheTextureHeight, contentSize );
auto data = _currentPageData + CacheTextureWidth * (int)startY;
_atlasTextures[_currentPage]->updateWithData(data, 0, startY,
CacheTextureWidth, CacheTextureHeight - startY);
startX = 0.0f;
startY = 0.0f;
_currentPageOrigY = 0;
memset(_currentPageData, 0, _currentPageDataSize);
_currentPage++;
auto tex = new Texture2D;
if (_antialiasEnabled)
{
tex->setAntiAliasTexParameters();
}
else
{
tex->setAliasTexParameters();
}
tex->initWithData(_currentPageData, _currentPageDataSize,
pixelFormat, CacheTextureWidth, CacheTextureHeight, Size(CacheTextureWidth,CacheTextureHeight) );
addTexture(tex,_currentPage);
tex->release();
}
@ -307,9 +325,9 @@ bool FontAtlas::prepareLetterDefinitions(unsigned short *utf16String)
if(existNewLetter)
{
// this is a memory leak as the texture previously in _atlasTextures[_currentPage] is not deleted from OpenGL
// see CCTexture2D::initWithData for the temporary fix
_atlasTextures[_currentPage]->initWithData(_currentPageData, _currentPageDataSize, pixelFormat, CacheTextureWidth, CacheTextureHeight, contentSize );
auto data = _currentPageData + CacheTextureWidth * (int)startY;
_atlasTextures[_currentPage]->updateWithData(data, 0, startY,
CacheTextureWidth, _currentPageOrigY - startY + _commonLineHeight);
}
return true;
}
@ -340,4 +358,28 @@ const Font * FontAtlas::getFont() const
return _font;
}
void FontAtlas::setAliasTexParameters()
{
if (_antialiasEnabled)
{
_antialiasEnabled = false;
for (const auto & tex : _atlasTextures)
{
tex.second->setAliasTexParameters();
}
}
}
void FontAtlas::setAntiAliasTexParameters()
{
if (! _antialiasEnabled)
{
_antialiasEnabled = true;
for (const auto & tex : _atlasTextures)
{
tex.second->setAntiAliasTexParameters();
}
}
}
NS_CC_END

View File

@ -98,6 +98,18 @@ public:
*/
void purgeTexturesAtlas();
/** sets font texture parameters:
- GL_TEXTURE_MIN_FILTER = GL_LINEAR
- GL_TEXTURE_MAG_FILTER = GL_LINEAR
*/
void setAntiAliasTexParameters();
/** sets font texture parameters:
- GL_TEXTURE_MIN_FILTER = GL_NEAREST
- GL_TEXTURE_MAG_FILTER = GL_NEAREST
*/
void setAliasTexParameters();
private:
void relaseTextures();
@ -118,6 +130,7 @@ private:
int _fontAscender;
EventListenerCustom* _toBackgroundListener;
EventListenerCustom* _toForegroundListener;
bool _antialiasEnabled;
};

View File

@ -84,6 +84,38 @@ const char* GLProgram::ATTRIBUTE_NAME_COLOR = "a_color";
const char* GLProgram::ATTRIBUTE_NAME_POSITION = "a_position";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD = "a_texCoord";
#define CC_GLPROGRAM_MAX_MATERIAL_ID_NUMBER 1024
GLProgram::MaterialProgramIDAllocator::MaterialProgramIDAllocator()
{
for(GLuint id = 1; id < CC_GLPROGRAM_MAX_MATERIAL_ID_NUMBER; ++id)
{
_freeIDs.insert(id);
}
}
GLProgram::MaterialProgramIDAllocator::~MaterialProgramIDAllocator()
{
//do nothing
}
GLuint GLProgram::MaterialProgramIDAllocator::allocID()
{
CCASSERT(_freeIDs.size()!=0, "There are no allocated ID");
GLuint id = *(_freeIDs.begin());
_freeIDs.erase(id);
return id;
}
void GLProgram::MaterialProgramIDAllocator::freeID(GLuint id)
{
CCASSERT(_freeIDs.find(id) == _freeIDs.end() && id != 0, "free id is 0 or a duplicated id");
_freeIDs.insert(id);
}
GLProgram::MaterialProgramIDAllocator GLProgram::_idAllocator;
const GLuint GLProgram::_maxMaterialIDNumber = CC_GLPROGRAM_MAX_MATERIAL_ID_NUMBER;
GLProgram::GLProgram()
: _program(0)
, _vertShader(0)
@ -92,10 +124,13 @@ GLProgram::GLProgram()
, _flags()
{
memset(_uniforms, 0, sizeof(_uniforms));
_materialProgramID = _idAllocator.allocID();
}
GLProgram::~GLProgram()
{
_idAllocator.freeID(_materialProgramID);
_materialProgramID = 0;
CCLOGINFO("%s %d deallocing GLProgram: %p", __FUNCTION__, __LINE__, this);
// there is no need to delete the shaders. They should have been already deleted.

View File

@ -34,6 +34,7 @@ THE SOFTWARE.
#include "CCRef.h"
#include "CCGL.h"
#include "kazmath/kazmath.h"
#include <set>
NS_CC_BEGIN
@ -256,7 +257,7 @@ public:
void reset();
inline const GLuint getProgram() const { return _program; }
inline const GLuint getMaterialProgramID() const { return _materialProgramID; }
// DEPRECATED
CC_DEPRECATED_ATTRIBUTE bool initWithVertexShaderByteArray(const GLchar* vShaderByteArray, const GLchar* fShaderByteArray)
{ return initWithByteArrays(vShaderByteArray, fShaderByteArray); }
@ -272,6 +273,8 @@ private:
std::string logForOpenGLObject(GLuint object, GLInfoFunction infoFunc, GLLogFunction logFunc) const;
private:
//ID used for renderer material, _materialProgramID maybe different from _program
GLuint _materialProgramID;
GLuint _program;
GLuint _vertShader;
GLuint _fragShader;
@ -292,6 +295,21 @@ private:
// handy way to initialize the bitfield
flag_struct() { memset(this, 0, sizeof(*this)); }
} _flags;
private:
class MaterialProgramIDAllocator
{
public:
MaterialProgramIDAllocator();
~MaterialProgramIDAllocator();
GLuint allocID();
void freeID(GLuint id);
private:
std::set<GLuint> _freeIDs;
};
static MaterialProgramIDAllocator _idAllocator;
public:
static const GLuint _maxMaterialIDNumber;
};
// end of shaders group

View File

@ -392,7 +392,16 @@ void Label::setFontAtlas(FontAtlas* atlas,bool distanceFieldEnabled /* = false *
}
_fontAtlas = atlas;
SpriteBatchNode::initWithTexture(_fontAtlas->getTexture(0), 30);
if (_textureAtlas)
{
_textureAtlas->setTexture(_fontAtlas->getTexture(0));
}
else
{
SpriteBatchNode::initWithTexture(_fontAtlas->getTexture(0), 30);
}
if (_reusedLetter == nullptr)
{
_reusedLetter = Sprite::createWithTexture(_fontAtlas->getTexture(0));

View File

@ -243,6 +243,7 @@ public:
virtual const Size& getContentSize() const override;
FontAtlas* getFontAtlas() { return _fontAtlas; }
/** Listen "come to background" message
It only has effect on Android.
*/

View File

@ -627,9 +627,25 @@ std::string LayerColor::getDescription() const
{
return StringUtils::format("<LayerColor | Tag = %d>", _tag);
}
//
// LayerGradient
//
//
LayerGradient::LayerGradient()
: _startColor(Color4B::BLACK)
, _endColor(Color4B::BLACK)
, _startOpacity(255)
, _endOpacity(255)
, _alongVector(Point(0, -1))
, _compressedInterpolation(true)
{
}
LayerGradient::~LayerGradient()
{
}
LayerGradient* LayerGradient::create(const Color4B& start, const Color4B& end)
{
LayerGradient * layer = new LayerGradient();
@ -684,9 +700,9 @@ bool LayerGradient::initWithColor(const Color4B& start, const Color4B& end, cons
_endColor.g = end.g;
_endColor.b = end.b;
_endOpacity = end.a;
_startOpacity = start.a;
_alongVector = v;
_endOpacity = end.a;
_startOpacity = start.a;
_alongVector = v;
_compressedInterpolation = true;

View File

@ -343,19 +343,6 @@ public:
/** Creates a full-screen Layer with a gradient between start and end in the direction of v. */
static LayerGradient* create(const Color4B& start, const Color4B& end, const Point& v);
virtual bool init();
/** Initializes the Layer with a gradient between start and end.
* @js init
* @lua init
*/
bool initWithColor(const Color4B& start, const Color4B& end);
/** Initializes the Layer with a gradient between start and end in the direction of v.
* @js init
* @lua init
*/
bool initWithColor(const Color4B& start, const Color4B& end, const Point& v);
/** Whether or not the interpolation will be compressed in order to display all the colors of the gradient both in canonical and non canonical vectors
Default: true
@ -391,6 +378,23 @@ public:
const Point& getVector() const;
virtual std::string getDescription() const override;
CC_CONSTRUCTOR_ACCESS:
LayerGradient();
virtual ~LayerGradient();
virtual bool init();
/** Initializes the Layer with a gradient between start and end.
* @js init
* @lua init
*/
bool initWithColor(const Color4B& start, const Color4B& end);
/** Initializes the Layer with a gradient between start and end in the direction of v.
* @js init
* @lua init
*/
bool initWithColor(const Color4B& start, const Color4B& end, const Point& v);
protected:
virtual void updateColor() override;

View File

@ -432,6 +432,7 @@ Texture2D::Texture2D()
, _hasPremultipliedAlpha(false)
, _hasMipmaps(false)
, _shaderProgram(nullptr)
, _antialiasEnabled(true)
{
}
@ -621,16 +622,29 @@ bool Texture2D::initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, PixelFormat
if (mipmapsNum == 1)
{
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _antialiasEnabled ? GL_LINEAR : GL_NEAREST);
}else
{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _antialiasEnabled ? GL_LINEAR_MIPMAP_NEAREST : GL_NEAREST_MIPMAP_NEAREST);
}
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _antialiasEnabled ? GL_LINEAR : GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
#if CC_ENABLE_CACHE_TEXTURE_DATA
if (_antialiasEnabled)
{
TexParams texParams = {(GLuint)(_hasMipmaps?GL_LINEAR_MIPMAP_NEAREST:GL_LINEAR),GL_LINEAR,GL_NONE,GL_NONE};
VolatileTextureMgr::setTexParameters(this, texParams);
}
else
{
TexParams texParams = {(GLuint)(_hasMipmaps?GL_NEAREST_MIPMAP_NEAREST:GL_NEAREST),GL_NEAREST,GL_NONE,GL_NONE};
VolatileTextureMgr::setTexParameters(this, texParams);
}
#endif
CHECK_GL_ERROR_DEBUG(); // clean possible GL error
// Specify OpenGL texture image
@ -682,6 +696,18 @@ bool Texture2D::initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, PixelFormat
return true;
}
bool Texture2D::updateWithData(const void *data,int offsetX,int offsetY,int width,int height)
{
if (_name)
{
GL::bindTexture2D(_name);
const PixelFormatInfo& info = _pixelFormatInfoTables.at(_pixelFormat);
glTexSubImage2D(GL_TEXTURE_2D,0,offsetX,offsetY,width,height,info.format, info.type,data);
return true;
}
return false;
}
std::string Texture2D::getDescription() const
{
@ -1240,6 +1266,18 @@ void Texture2D::setTexParameters(const TexParams &texParams)
void Texture2D::setAliasTexParameters()
{
if (! _antialiasEnabled)
{
return;
}
_antialiasEnabled = false;
if (_name == 0)
{
return;
}
GL::bindTexture2D( _name );
if( ! _hasMipmaps )
@ -1260,6 +1298,18 @@ void Texture2D::setAliasTexParameters()
void Texture2D::setAntiAliasTexParameters()
{
if ( _antialiasEnabled )
{
return;
}
_antialiasEnabled = true;
if (_name == 0)
{
return;
}
GL::bindTexture2D( _name );
if( ! _hasMipmaps )

View File

@ -223,6 +223,8 @@ public:
/** Initializes with mipmaps */
bool initWithMipmaps(MipmapInfo* mipmaps, int mipmapsNum, Texture2D::PixelFormat pixelFormat, int pixelsWide, int pixelsHigh);
/** Update with texture data*/
bool updateWithData(const void *data,int offsetX,int offsetY,int width,int height);
/**
Drawing extensions to make it easy to draw basic quads using a Texture2D object.
These functions require GL_TEXTURE_2D and both GL_VERTEX_ARRAY and GL_TEXTURE_COORD_ARRAY client states to be enabled.
@ -434,6 +436,8 @@ protected:
GLProgram* _shaderProgram;
static const PixelFormatInfoMap _pixelFormatInfoTables;
bool _antialiasEnabled;
};

View File

@ -61,9 +61,7 @@ void QuadCommand::generateMaterialID()
{
//Generate Material ID
//TODO fix shader ID generation
CCASSERT(_shader->getProgram() < pow(2,10), "ShaderID is greater than 2^10");
//TODO fix texture ID generation
CCASSERT(_textureID < pow(2,18), "TextureID is greater than 2^18");
CCASSERT(_shader->getMaterialProgramID() < GLProgram::_maxMaterialIDNumber, "ShaderID is greater than Id limitation");
//TODO fix blend id generation
int blendID = 0;
@ -96,7 +94,7 @@ void QuadCommand::generateMaterialID()
// | Shader ID (10 bits) | Blend ID (4 bits) | empty (18bits) | Texture ID (32 bits) |
// +---------------------+-------------------+----------------------------------------+
_materialID = (uint64_t)_shader->getProgram() << 54
_materialID = (uint64_t)_shader->getMaterialProgramID() << 54
| (uint64_t)blendID << 50
| (uint64_t)_textureID << 0;
}

View File

@ -100,6 +100,7 @@ typedef enum {
BOOL backgroundMusic;
// whether background music is paused
BOOL paused;
BOOL stopped;
@public
BOOL systemPaused;//Used for auto resign handling
NSTimeInterval systemPauseLocation;//Used for auto resign handling

View File

@ -48,6 +48,7 @@ NSString * const kCDN_AudioManagerInitialised = @"kCDN_AudioManagerInitialised";
mute = NO;
enabled_ = YES;
paused = NO;
stopped = NO;
}
return self;
}
@ -96,6 +97,7 @@ NSString * const kCDN_AudioManagerInitialised = @"kCDN_AudioManagerInitialised";
if (enabled_) {
self->systemPaused = NO;
self->paused = NO;
self->stopped = NO;
[audioSourcePlayer play];
} else {
CDLOGINFO(@"Denshion::CDLongAudioSource long audio source didn't play because it is disabled");
@ -104,6 +106,7 @@ NSString * const kCDN_AudioManagerInitialised = @"kCDN_AudioManagerInitialised";
-(void) stop {
self->paused = NO;
self->stopped = YES;
[audioSourcePlayer stop];
}
@ -118,9 +121,11 @@ NSString * const kCDN_AudioManagerInitialised = @"kCDN_AudioManagerInitialised";
}
-(void) resume {
self->paused = NO;
[audioSourcePlayer play];
}
if (!stopped) {
self->paused = NO;
[audioSourcePlayer play];
}
}
-(BOOL) isPlaying {
if (state != kLAS_Init) {

View File

@ -119,7 +119,7 @@ NSString * const kCDN_AudioManagerInitialised = @"kCDN_AudioManagerInitialised";
-(void) resume {
self->paused = NO;
[audioSourcePlayer play];
[audioSourcePlayer resume];
}
-(BOOL) isPlaying {

View File

@ -96,6 +96,7 @@ extern OSStatus AudioSessionGetProperty(UInt32 inID, UInt32 *ioDataSize, void *o
- (BOOL)playAtTime:(NSTimeInterval) time; /* play a sound some time in the future. time should be greater than deviceCurrentTime. */
- (void)pause; /* pauses playback, but remains ready to play. */
- (void)stop; /* stops playback. no longer ready to play. */
- (BOOL) resume;
/* properties */

View File

@ -88,7 +88,13 @@ OSStatus AudioSessionGetProperty(UInt32 inID, UInt32 *ioDataSize, void *outData)
result = [_player resume];
}
return result;
}
}
- (BOOL) resume{
BOOL result = [_player resume];
return result;
}
-(void) pause {
[_player pause];

View File

@ -112,6 +112,11 @@
-- @function [parent=#Director] startAnimation
-- @param self
--------------------------------
-- @function [parent=#Director] getOpenGLView
-- @param self
-- @return GLView#GLView ret (return value: cc.GLView)
--------------------------------
-- @function [parent=#Director] getRunningScene
-- @param self

View File

@ -53,6 +53,11 @@
-- @param self
-- @param #kmMat4 kmmat4
--------------------------------
-- @function [parent=#GLProgram] getMaterialProgramID
-- @param self
-- @return unsigned int#unsigned int ret (return value: unsigned int)
--------------------------------
-- @function [parent=#GLProgram] setUniformLocationWith3i
-- @param self

View File

@ -84,6 +84,11 @@
-- @param #point_table point
-- @return bool#bool ret (return value: bool)
--------------------------------
-- @function [parent=#Label] getFontAtlas
-- @param self
-- @return FontAtlas#FontAtlas ret (return value: cc.FontAtlas)
--------------------------------
-- @function [parent=#Label] getFontDefinition
-- @param self

View File

@ -43,20 +43,6 @@
-- @param self
-- @return point_table#point_table ret (return value: point_table)
--------------------------------
-- overload function: initWithColor(color4B_table, color4B_table)
--
-- overload function: initWithColor()
--
-- overload function: initWithColor(color4B_table, color4B_table, point_table)
--
-- @function [parent=#LayerGradient] initWithColor
-- @param self
-- @param #color4B_table color4b
-- @param #color4B_table color4b
-- @param #point_table point
-- @return bool#bool ret (retunr value: bool)
--------------------------------
-- @function [parent=#LayerGradient] setEndColor
-- @param self

View File

@ -0,0 +1,86 @@
--------------------------------
-- @module ProtectedNode
-- @extend Node
--------------------------------
-- overload function: addProtectedChild(cc.Node, int)
--
-- overload function: addProtectedChild(cc.Node)
--
-- overload function: addProtectedChild(cc.Node, int, int)
--
-- @function [parent=#ProtectedNode] addProtectedChild
-- @param self
-- @param #cc.Node node
-- @param #int int
-- @param #int int
--------------------------------
-- @function [parent=#ProtectedNode] disableCascadeColor
-- @param self
--------------------------------
-- @function [parent=#ProtectedNode] removeProtectedChildByTag
-- @param self
-- @param #int int
-- @param #bool bool
--------------------------------
-- @function [parent=#ProtectedNode] reorderProtectedChild
-- @param self
-- @param #cc.Node node
-- @param #int int
--------------------------------
-- @function [parent=#ProtectedNode] removeAllProtectedChildrenWithCleanup
-- @param self
-- @param #bool bool
--------------------------------
-- @function [parent=#ProtectedNode] sortAllProtectedChildren
-- @param self
--------------------------------
-- @function [parent=#ProtectedNode] getProtectedChildByTag
-- @param self
-- @param #int int
-- @return Node#Node ret (return value: cc.Node)
--------------------------------
-- @function [parent=#ProtectedNode] removeProtectedChild
-- @param self
-- @param #cc.Node node
-- @param #bool bool
--------------------------------
-- @function [parent=#ProtectedNode] removeAllProtectedChildren
-- @param self
--------------------------------
-- @function [parent=#ProtectedNode] create
-- @param self
-- @return ProtectedNode#ProtectedNode ret (return value: cc.ProtectedNode)
--------------------------------
-- @function [parent=#ProtectedNode] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #kmMat4 kmmat4
-- @param #bool bool
--------------------------------
-- @function [parent=#ProtectedNode] updateDisplayedOpacity
-- @param self
-- @param #unsigned char char
--------------------------------
-- @function [parent=#ProtectedNode] updateDisplayedColor
-- @param self
-- @param #color3B_table color3b
--------------------------------
-- @function [parent=#ProtectedNode] cleanup
-- @param self
return nil

View File

@ -39,6 +39,16 @@
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
-- @function [parent=#Texture2D] updateWithData
-- @param self
-- @param #void void
-- @param #int int
-- @param #int int
-- @param #int int
-- @param #int int
-- @return bool#bool ret (return value: bool)
--------------------------------
-- @function [parent=#Texture2D] hasPremultipliedAlpha
-- @param self

View File

@ -1196,4 +1196,9 @@
-- @field [parent=#cc] SimpleAudioEngine#SimpleAudioEngine SimpleAudioEngine preloaded module
--------------------------------------------------------
-- the cc ProtectedNode
-- @field [parent=#cc] ProtectedNode#ProtectedNode ProtectedNode preloaded module
return nil

View File

@ -1 +1 @@
bb331bf4e55b4ca2f5b12c75e6c3e638ae3367d0
491f36052e7ee592286d55bcb9b0425b7ca95332

View File

@ -1534,6 +1534,20 @@ int register_all_cocos2dx(lua_State* tolua_S);

View File

@ -162,11 +162,11 @@ public:
virtual void updateDisplayedOpacity(GLubyte parentOpacity) override;
virtual void updateDisplayedColor(const Color3B& parentColor) override;
virtual void disableCascadeColor() override;
protected:
CC_CONSTRUCTOR_ACCESS:
ProtectedNode();
virtual ~ProtectedNode();
protected:
/// helper that reorder a child
void insertProtectedChild(Node* child, int z);

View File

@ -1 +1 @@
8cce920bd091a03ab1e10db03eb397451b0d70c5
7eeab29cb8dd0daa3e3868c60088dcabda899dae

View File

@ -37,7 +37,7 @@ void AccelerometerTest::onEnter()
auto listener = EventListenerAcceleration::create(CC_CALLBACK_2(AccelerometerTest::onAcceleration, this));
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
auto label = LabelTTF::create(title().c_str(), "Arial", 32);
auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32.0f);
addChild(label, 1);
label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y-50) );

View File

@ -198,7 +198,7 @@ void PauseTest::onEnter()
ActionManagerTest::onEnter();
auto l = LabelTTF::create("After 5 seconds grossini should move", "Thonburi", 16);
auto l = Label::create("After 5 seconds grossini should move", "fonts/Thonburi.ttf", 16.0f);
addChild(l);
l->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y-75) );
@ -240,7 +240,7 @@ void StopActionTest::onEnter()
{
ActionManagerTest::onEnter();
auto l = LabelTTF::create("Should not crash", "Thonburi", 16);
auto l = Label::create("Should not crash", "fonts/Thonburi.ttf", 16.0f);
addChild(l);
l->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 75) );
@ -281,7 +281,7 @@ void ResumeTest::onEnter()
{
ActionManagerTest::onEnter();
auto l = LabelTTF::create("Grossini only rotate/scale in 3 seconds", "Thonburi", 16);
auto l = Label::create("Grossini only rotate/scale in 3 seconds", "fonts/Thonburi.ttf", 16.0f);
addChild(l);
l->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 75));

View File

@ -388,7 +388,7 @@ void SpriteProgressBarTintAndFade::onEnter()
left->runAction(RepeatForever::create(to->clone()));
left->runAction(RepeatForever::create(tint->clone()));
left->addChild(LabelTTF::create("Tint", "Marker Felt", 20.0f));
left->addChild(Label::create("Tint", "fonts/Marker Felt.ttf", 20.0f));
auto middle = ProgressTimer::create(Sprite::create(s_pathSister2));
middle->setType(ProgressTimer::Type::BAR);
@ -401,7 +401,7 @@ void SpriteProgressBarTintAndFade::onEnter()
middle->runAction(RepeatForever::create(to->clone()));
middle->runAction(RepeatForever::create(fade->clone()));
middle->addChild(LabelTTF::create("Fade", "Marker Felt", 20.0f));
middle->addChild(Label::create("Fade", "fonts/Marker Felt.ttf", 20.0f));
auto right = ProgressTimer::create(Sprite::create(s_pathSister2));
right->setType(ProgressTimer::Type::BAR);
@ -415,7 +415,7 @@ void SpriteProgressBarTintAndFade::onEnter()
right->runAction(RepeatForever::create(tint->clone()));
right->runAction(RepeatForever::create(fade->clone()));
right->addChild(LabelTTF::create("Tint and Fade", "Marker Felt", 20.0f));
right->addChild(Label::create("Tint and Fade", "fonts/Marker Felt.ttf", 20.0f));
}
std::string SpriteProgressBarTintAndFade::subtitle() const

View File

@ -398,7 +398,7 @@ void ActionRotationalSkewVSStandardSkew::onEnter()
box->setPosition(Point(s.width/2, s.height - 100 - box->getContentSize().height/2));
this->addChild(box);
auto label = LabelTTF::create("Standard cocos2d Skew", "Marker Felt", 16);
auto label = Label::create("Standard cocos2d Skew", "fonts/Marker Felt.ttf", 16.0f);
label->setPosition(Point(s.width/2, s.height - 100 + label->getContentSize().height));
this->addChild(label);
@ -414,7 +414,7 @@ void ActionRotationalSkewVSStandardSkew::onEnter()
box->setPosition(Point(s.width/2, s.height - 250 - box->getContentSize().height/2));
this->addChild(box);
label = LabelTTF::create("Rotational Skew", "Marker Felt", 16);
label = Label::create("Rotational Skew", "fonts/Marker Felt.ttf", 16.0f);
label->setPosition(Point(s.width/2, s.height - 250 + label->getContentSize().height/2));
this->addChild(label);
auto actionTo2 = RotateBy::create(2, 360, 0);
@ -811,7 +811,7 @@ void ActionSequence2::onEnter()
void ActionSequence2::callback1()
{
auto s = Director::getInstance()->getWinSize();
auto label = LabelTTF::create("callback 1 called", "Marker Felt", 16);
auto label = Label::create("callback 1 called", "fonts/Marker Felt.ttf", 16.0f);
label->setPosition(Point( s.width/4*1,s.height/2));
addChild(label);
@ -820,7 +820,7 @@ void ActionSequence2::callback1()
void ActionSequence2::callback2(Node* sender)
{
auto s = Director::getInstance()->getWinSize();
auto label = LabelTTF::create("callback 2 called", "Marker Felt", 16);
auto label = Label::create("callback 2 called", "fonts/Marker Felt.ttf", 16.0f);
label->setPosition(Point( s.width/4*2,s.height/2));
addChild(label);
@ -829,7 +829,7 @@ void ActionSequence2::callback2(Node* sender)
void ActionSequence2::callback3(Node* sender, long data)
{
auto s = Director::getInstance()->getWinSize();
auto label = LabelTTF::create("callback 3 called", "Marker Felt", 16);
auto label = Label::create("callback 3 called", "fonts/Marker Felt.ttf", 16.0f);
label->setPosition(Point( s.width/4*3,s.height/2));
addChild(label);
@ -962,7 +962,7 @@ void ActionCallFunction::onEnter()
// lambda
[&](){
auto s = Director::getInstance()->getWinSize();
auto label = LabelTTF::create("called:lambda callback", "Marker Felt", 16);
auto label = Label::create("called:lambda callback", "fonts/Marker Felt.ttf", 16.0f);
label->setPosition(Point( s.width/4*1,s.height/2-40));
this->addChild(label);
} ),
@ -989,7 +989,7 @@ void ActionCallFunction::onEnter()
void ActionCallFunction::callback1()
{
auto s = Director::getInstance()->getWinSize();
auto label = LabelTTF::create("callback 1 called", "Marker Felt", 16);
auto label = Label::create("callback 1 called", "fonts/Marker Felt.ttf", 16.0f);
label->setPosition(Point( s.width/4*1,s.height/2));
addChild(label);
@ -998,7 +998,7 @@ void ActionCallFunction::callback1()
void ActionCallFunction::callback2(Node* sender)
{
auto s = Director::getInstance()->getWinSize();
auto label = LabelTTF::create("callback 2 called", "Marker Felt", 16);
auto label = Label::create("callback 2 called", "fonts/Marker Felt.ttf", 16.0f);
label->setPosition(Point( s.width/4*2,s.height/2));
addChild(label);
@ -1009,7 +1009,7 @@ void ActionCallFunction::callback2(Node* sender)
void ActionCallFunction::callback3(Node* sender, long data)
{
auto s = Director::getInstance()->getWinSize();
auto label = LabelTTF::create("callback 3 called", "Marker Felt", 16);
auto label = Label::create("callback 3 called", "fonts/Marker Felt.ttf", 16.0f);
label->setPosition(Point( s.width/4*3,s.height/2));
addChild(label);

View File

@ -37,14 +37,17 @@ void BaseTest::onEnter()
// add title and subtitle
std::string str = title();
const char * pTitle = str.c_str();
auto label = LabelTTF::create(pTitle, "Arial", 32);
TTFConfig ttfConfig("fonts/arial.ttf", 32);
auto label = Label::createWithTTF(ttfConfig,pTitle);
addChild(label, 9999);
label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 30) );
std::string strSubtitle = subtitle();
if( ! strSubtitle.empty() )
{
auto l = LabelTTF::create(strSubtitle.c_str(), "Thonburi", 16);
ttfConfig.fontFilePath = "fonts/Thonburi.ttf";
ttfConfig.fontSize = 16;
auto l = Label::createWithTTF(ttfConfig,strSubtitle.c_str());
addChild(l, 9999);
l->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 60) );
}

View File

@ -43,15 +43,15 @@ Box2DTestLayer::Box2DTestLayer()
addNewSpriteAtPosition(VisibleRect::center());
auto label = LabelTTF::create("Tap screen", "Marker Felt", 32);
auto label = Label::create("Tap screen", "fonts/Marker Felt.ttf", 32.0f);
addChild(label, 0);
label->setColor(Color3B(0,0,255));
label->setPosition(Point( VisibleRect::center().x, VisibleRect::top().y-50));
scheduleUpdate();
#else
auto label = LabelTTF::create("Should define CC_ENABLE_BOX2D_INTEGRATION=1\n to run this test case",
"Arial",
auto label = Label::create("Should define CC_ENABLE_BOX2D_INTEGRATION=1\n to run this test case",
"fonts/arial.ttf",
18);
auto size = Director::getInstance()->getWinSize();
label->setPosition(Point(size.width/2, size.height/2));

View File

@ -58,12 +58,8 @@ bool MenuLayer::initWithEntryID(int entryId)
addChild(view, 0, kTagBox2DNode);
view->setScale(15);
view->setAnchorPoint( Point(0,0) );
view->setPosition( Point(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/3) );
//#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE)
// auto label = LabelBMFont::create(view->title().c_str(), "fonts/arial16.fnt");
//#else
auto label = LabelTTF::create(view->title().c_str(), "Arial", 28);
//#endif
view->setPosition( Point(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/3) );
auto label = Label::create(view->title().c_str(), "fonts/arial.ttf", 28);
addChild(label, 1);
label->setPosition( Point(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height-50) );

View File

@ -45,7 +45,7 @@ bool Bug1159Layer::init()
sprite_b->setPosition(Point(s.width/2, s.height/2));
addChild(sprite_b);
auto label = MenuItemLabel::create(LabelTTF::create("Flip Me", "Helvetica", 24), CC_CALLBACK_1(Bug1159Layer::callBack, this) );
auto label = MenuItemLabel::create(Label::create("Flip Me", "Helvetica", 24), CC_CALLBACK_1(Bug1159Layer::callBack, this) );
auto menu = Menu::create(label, NULL);
menu->setPosition(Point(s.width - 200.0f, 50.0f));
addChild(menu);

View File

@ -9,7 +9,7 @@ bool QuestionContainerSprite::init()
if (Sprite::init())
{
//Add label
auto label = LabelTTF::create("Answer 1", "Arial", 12);
auto label = Label::create("Answer 1", "fonts/arial.ttf", 12);
label->setTag(100);
//Add the background

View File

@ -20,7 +20,7 @@ bool Bug624Layer::init()
if(BugsTestBaseLayer::init())
{
auto size = Director::getInstance()->getWinSize();
auto label = LabelTTF::create("Layer1", "Marker Felt", 36);
auto label = Label::create("Layer1", "fonts/Marker Felt.ttf", 36.0f);
label->setPosition(Point(size.width/2, size.height/2));
addChild(label);
@ -66,7 +66,7 @@ bool Bug624Layer2::init()
if(BugsTestBaseLayer::init())
{
auto size = Director::getInstance()->getWinSize();
auto label = LabelTTF::create("Layer2", "Marker Felt", 36);
auto label = Label::create("Layer2", "fonts/Marker Felt.ttf", 36.0f);
label->setPosition(Point(size.width/2, size.height/2));
addChild(label);

View File

@ -49,7 +49,7 @@ bool Bug914Layer::init()
}
// create and initialize a Label
auto label = LabelTTF::create("Hello World", "Marker Felt", 64);
auto label = Label::create("Hello World", "fonts/Marker Felt.ttf", 64.0f);
auto item1 = MenuItemFont::create("restart", CC_CALLBACK_1(Bug914Layer::restart, this));
auto menu = Menu::create(item1, NULL);

View File

@ -56,7 +56,7 @@ void BugsTestMainLayer::onEnter()
auto s = Director::getInstance()->getWinSize();
_itmeMenu = Menu::create();
MenuItemFont::setFontName("Arial");
MenuItemFont::setFontName("fonts/arial.ttf");
MenuItemFont::setFontSize(24);
for (int i = 0; i < g_maxitems; ++i)
{
@ -114,7 +114,7 @@ void BugsTestBaseLayer::onEnter()
{
Layer::onEnter();
MenuItemFont::setFontName("Arial");
MenuItemFont::setFontName("fonts/arial.ttf");
MenuItemFont::setFontSize(24);
auto pMainItem = MenuItemFont::create("Back", CC_CALLBACK_1(BugsTestBaseLayer::backCallback, this));
pMainItem->setPosition(Point(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25));

View File

@ -31,7 +31,7 @@ ChipmunkTestLayer::ChipmunkTestLayer()
_eventDispatcher->addEventListenerWithSceneGraphPriority(accListener, this);
// title
auto label = LabelTTF::create("Multi touch the screen", "Marker Felt", 36);
auto label = Label::create("Multi touch the screen", "fonts/Marker Felt.ttf", 36.0f);
label->setPosition(cocos2d::Point( VisibleRect::center().x, VisibleRect::top().y - 30));
this->addChild(label, -1);
@ -64,8 +64,8 @@ ChipmunkTestLayer::ChipmunkTestLayer()
scheduleUpdate();
#else
auto label = LabelTTF::create("Should define CC_ENABLE_CHIPMUNK_INTEGRATION=1\n to run this test case",
"Arial",
auto label = Label::create("Should define CC_ENABLE_CHIPMUNK_INTEGRATION=1\n to run this test case",
"fonts/arial.ttf",
18);
auto size = Director::getInstance()->getWinSize();
label->setPosition(Point(size.width/2, size.height/2));

View File

@ -827,7 +827,7 @@ void RawStencilBufferTest6::setup()
glClear(GL_STENCIL_BUFFER_BIT);
glFlush();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &bits);
auto clearToZeroLabel = LabelTTF::create(String::createWithFormat("00=%02x", bits[0])->getCString(), "Arial", 20);
auto clearToZeroLabel = Label::create(String::createWithFormat("00=%02x", bits[0])->getCString(), "fonts/arial.ttf", 20);
clearToZeroLabel->setPosition( Point((winPoint.x / 3) * 1, winPoint.y - 10) );
this->addChild(clearToZeroLabel);
glStencilMask(0x0F);
@ -835,7 +835,7 @@ void RawStencilBufferTest6::setup()
glClear(GL_STENCIL_BUFFER_BIT);
glFlush();
glReadPixels(0, 0, 1, 1, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, &bits);
auto clearToMaskLabel = LabelTTF::create(String::createWithFormat("0a=%02x", bits[0])->getCString(), "Arial", 20);
auto clearToMaskLabel = Label::create(String::createWithFormat("0a=%02x", bits[0])->getCString(), "fonts/arial.ttf", 20);
clearToMaskLabel->setPosition( Point((winPoint.x / 3) * 2, winPoint.y - 10) );
this->addChild(clearToMaskLabel);
#endif

View File

@ -91,7 +91,7 @@ private:
bool initTextButton(const char *text)
{
_child = LabelTTF::create(text, "Arial", 16);
_child = Label::create(text, "fonts/arial.ttf", 16);
addChild(_child);
return true;
}
@ -172,7 +172,7 @@ public:
sprintf(buffer, "%.2f", minValue);
if (!_lblMinValue) {
_lblMinValue = LabelTTF::create(buffer, "Arial", 8);
_lblMinValue = Label::create(buffer, "fonts/arial.ttf", 8);
addChild(_lblMinValue);
if (_direction == Vertical)
_lblMinValue->setPosition(Point(12.0, -50.0));
@ -184,7 +184,7 @@ public:
sprintf(buffer, "%.2f", maxValue);
if (!_lblMaxValue) {
_lblMaxValue = LabelTTF::create(buffer, "Arial", 8);
_lblMaxValue = Label::create(buffer, "fonts/arial.ttf", 8);
addChild(_lblMaxValue);
if (_direction == Vertical)
_lblMaxValue->setPosition(Point(12.0, 50.0));
@ -216,8 +216,8 @@ private:
Direction _direction;
extension::ControlSlider *_slider;
LabelTTF *_lblMinValue;
LabelTTF *_lblMaxValue;
Label *_lblMinValue;
Label *_lblMaxValue;
};
CocosDenshionTest::CocosDenshionTest()
@ -256,7 +256,7 @@ void CocosDenshionTest::onExit()
void CocosDenshionTest::addButtons()
{
auto lblMusic = LabelTTF::create("Control Music", "Arial", 24);
auto lblMusic = Label::create("Control Music", "fonts/arial.ttf", 24);
addChildAt(lblMusic, 0.25f, 0.9f);
Button *btnPlay = Button::createWithText("play");
@ -298,7 +298,7 @@ void CocosDenshionTest::addButtons()
});
addChildAt(btnIsPlayingMusic, 0.4f, 0.65f);
auto lblSound = LabelTTF::create("Control Effects", "Arial", 24);
auto lblSound = Label::create("Control Effects", "fonts/arial.ttf", 24);
addChildAt(lblSound, 0.75f, 0.9f);
Button *btnPlayEffect = Button::createWithText("play");
@ -364,31 +364,31 @@ void CocosDenshionTest::addButtons()
void CocosDenshionTest::addSliders()
{
auto lblPitch = LabelTTF::create("Pitch", "Arial", 14);
auto lblPitch = Label::create("Pitch", "fonts/arial.ttf", 14);
addChildAt(lblPitch, 0.67f, 0.4f);
_sliderPitch = AudioSlider::create(AudioSlider::Horizontal);
_sliderPitch->setValue(0.5, 2, 1);
addChildAt(_sliderPitch, 0.85f, 0.4f);
auto lblPan = LabelTTF::create("Pan", "Arial", 14);
auto lblPan = Label::create("Pan", "fonts/arial.ttf", 14);
addChildAt(lblPan, 0.67f, 0.3f);
_sliderPan = AudioSlider::create(AudioSlider::Horizontal);
_sliderPan->setValue(-1, 1, 0);
addChildAt(_sliderPan, 0.85f, 0.3f);
auto lblGain = LabelTTF::create("Gain", "Arial", 14);
auto lblGain = Label::create("Gain", "fonts/arial.ttf", 14);
addChildAt(lblGain, 0.67f, 0.2f);
_sliderGain = AudioSlider::create(AudioSlider::Horizontal);
_sliderGain->setValue(0, 1, 1);
addChildAt(_sliderGain, 0.85f, 0.2f);
auto lblEffectsVolume = LabelTTF::create("Effects Volume", "Arial", 14);
auto lblEffectsVolume = Label::create("Effects Volume", "fonts/arial.ttf", 14);
addChildAt(lblEffectsVolume, 0.62f, 0.5f);
_sliderEffectsVolume = AudioSlider::create(AudioSlider::Horizontal);
_sliderEffectsVolume->setValue(0, 1, 1);
addChildAt(_sliderEffectsVolume, 0.85f, 0.5f);
auto lblMusicVolume = LabelTTF::create("Music Volume", "Arial", 14);
auto lblMusicVolume = Label::create("Music Volume", "fonts/arial.ttf", 14);
addChildAt(lblMusicVolume, 0.12f, 0.5f);
_sliderMusicVolume = AudioSlider::create(AudioSlider::Horizontal);
_sliderMusicVolume->setValue(0, 1, 1);

View File

@ -5,7 +5,7 @@
CurlTest::CurlTest()
{
auto label = LabelTTF::create("Curl Test", "Arial", 28);
auto label = Label::create("Curl Test", "fonts/arial.ttf", 28);
addChild(label, 0);
label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y-50) );
@ -14,7 +14,7 @@ CurlTest::CurlTest()
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
// create a label to display the tip string
_label = LabelTTF::create("Touch the screen to connect", "Arial", 22);
_label = Label::create("Touch the screen to connect", "fonts/arial.ttf", 22);
_label->setPosition(VisibleRect::center());
addChild(_label, 0);

View File

@ -13,7 +13,7 @@ public:
void onTouchesEnded(const std::vector<Touch*>& touches, cocos2d::Event *event);
private:
cocos2d::LabelTTF* _label;
cocos2d::Label* _label;
};
class CurlTestScene : public TestScene

View File

@ -2,11 +2,11 @@
CurrentLanguageTest::CurrentLanguageTest()
{
auto label = LabelTTF::create("Current language Test", "Arial", 28);
auto label = Label::create("Current language Test", "fonts/arial.ttf", 28);
addChild(label, 0);
label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y-50) );
auto labelLanguage = LabelTTF::create("", "Arial", 20);
auto labelLanguage = Label::create("", "fonts/arial.ttf", 20);
labelLanguage->setPosition(VisibleRect::center());
LanguageType currentLanguageType = Application::getInstance()->getCurrentLanguage();

View File

@ -39,14 +39,14 @@ void PrettyPrinterDemo::onEnter()
Layer::onEnter();
auto s = Director::getInstance()->getWinSize();
auto label = LabelTTF::create(title().c_str(), "Arial", 28);
auto label = Label::create(title().c_str(), "fonts/arial.ttf", 28);
label->setPosition( Point(s.width/2, s.height * 4/5) );
this->addChild(label, 1);
std::string strSubtitle = subtitle();
if(strSubtitle.empty() == false)
{
auto subLabel = LabelTTF::create(strSubtitle.c_str(), "Thonburi", 16);
auto subLabel = Label::create(strSubtitle.c_str(), "fonts/Thonburi.ttf", 16);
subLabel->setPosition( Point(s.width/2, s.height * 3/5) );
this->addChild(subLabel, 1);
}

View File

@ -366,7 +366,7 @@ TextLayer::TextLayer(void)
auto sc2_back = sc2->reverse();
tamara->runAction( RepeatForever::create(Sequence::create(sc2, sc2_back, NULL)) );
auto label = LabelTTF::create((effectsList[actionIdx]).c_str(), "Marker Felt", 32);
auto label = Label::create((effectsList[actionIdx]).c_str(), "fonts/Marker Felt.ttf", 32);
label->setPosition( Point(VisibleRect::center().x,VisibleRect::top().y-80) );
addChild(label);

View File

@ -160,16 +160,16 @@ void ArmatureTestLayer::onEnter()
// add title and subtitle
std::string str = title();
const char *pTitle = str.c_str();
LabelTTF *label = LabelTTF::create(pTitle, "Arial", 18);
label->setColor(Color3B(0, 0, 0));
auto label = Label::create(pTitle, "fonts/arial.ttf", 18);
label->setColor(Color3B::BLACK);
addChild(label, 1, 10000);
label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 30) );
std::string strSubtitle = subtitle();
if( ! strSubtitle.empty() )
{
LabelTTF *l = LabelTTF::create(strSubtitle.c_str(), "Arial", 18);
l->setColor(Color3B(0, 0, 0));
auto l = Label::create(strSubtitle.c_str(), "fonts/arial.ttf", 18);
l->setColor(Color3B::BLACK);
addChild(l, 1, 10001);
l->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 60) );
}
@ -243,7 +243,7 @@ void TestAsynchronousLoading::onEnter()
char pszPercent[255];
sprintf(pszPercent, "%s %f", subtitle().c_str(), 0.0f);
LabelTTF *label = (LabelTTF *)getChildByTag(10001);
auto label = (Label *)getChildByTag(10001);
label->setString(pszPercent);
@ -277,7 +277,7 @@ void TestAsynchronousLoading::restartCallback(Ref* pSender)
}
void TestAsynchronousLoading::dataLoaded(float percent)
{
LabelTTF *label = (LabelTTF *)getChildByTag(10001);
auto label = (Label *)getChildByTag(10001);
if (label)
{
char pszPercent[255];
@ -436,7 +436,7 @@ void TestPerformance::refreshTitle()
{
char pszCount[255];
sprintf(pszCount, "%s %i", subtitle().c_str(), armatureCount);
LabelTTF *label = (LabelTTF *)getChildByTag(10001);
auto label = (Label *)getChildByTag(10001);
label->setString(pszCount);
}
@ -703,7 +703,7 @@ void TestUseMutiplePicture::onEnter()
// armature->getBone("weapon")->addDisplay(&displayData, i);
// }
LabelTTF *l = LabelTTF::create("This is a weapon!", "Arial", 18);
auto l = Label::create("This is a weapon!", "fonts/arial.ttf", 18);
l->setAnchorPoint(Point(0.2f, 0.5f));
armature->getBone("weapon")->addDisplay(l, 7);
}
@ -1275,7 +1275,7 @@ void TestArmatureNesting2::onEnter()
touchedMenu = false;
LabelTTF* label = CCLabelTTF::create("Change Mount", "Arial", 20);
auto label = Label::create("Change Mount", "fonts/arial.ttf", 20);
MenuItemLabel* pMenuItem = CCMenuItemLabel::create(label, CC_CALLBACK_1(TestArmatureNesting2::changeMountCallback, this));
Menu* pMenu =Menu::create(pMenuItem, nullptr);
@ -1441,7 +1441,7 @@ void TestEasing::onTouchesEnded(const std::vector<Touch*>& touches, Event* event
void TestEasing::updateSubTitle()
{
std::string str = subtitle() + armature->getAnimation()->getCurrentMovementID();
LabelTTF *label = (LabelTTF *)getChildByTag(10001);
auto label = (Label *)getChildByTag(10001);
label->setString(str.c_str());
}

View File

@ -60,7 +60,7 @@ bool GameOverLayer::init()
if ( LayerColor::initWithColor( Color4B(255,255,255,255) ) )
{
auto winSize = Director::getInstance()->getWinSize();
this->_label = LabelTTF::create("","Artial", 32);
this->_label = Label::create("","fonts/arial.ttf", 32);
_label->retain();
_label->setColor( Color3B(0, 0, 0) );
_label->setPosition( Point(winSize.width/2, winSize.height/2) );

View File

@ -13,7 +13,7 @@ public:
void gameOverDone();
CC_SYNTHESIZE_READONLY(cocos2d::LabelTTF*, _label, Label);
CC_SYNTHESIZE_READONLY(cocos2d::Label*, _label, Label);
};
class GameOverScene : public cocos2d::Scene

View File

@ -69,7 +69,7 @@ void CocoStudioGUIMainLayer::onEnter()
_itemMenu = CCMenu::create();
_itemMenu->setPosition(Point::ZERO);
CCMenuItemFont::setFontName("Arial");
CCMenuItemFont::setFontName("fonts/arial.ttf");
CCMenuItemFont::setFontSize(24);
for (int i = 0; i < g_maxTests; ++i)
{
@ -133,7 +133,7 @@ void CocoStudioGUITestScene::onEnter()
{
CCScene::onEnter();
LabelTTF* label = LabelTTF::create("Back", "Arial", 20);
auto label = Label::create("Back", "fonts/arial.ttf", 20);
//#endif
MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CocoStudioGUITestScene::BackCallback, this));

View File

@ -286,7 +286,7 @@ void CocosGUITestMainLayer::onEnter()
_itemMenu = Menu::create();
_itemMenu->setPosition( s_tCurPos );
MenuItemFont::setFontName("Arial");
MenuItemFont::setFontName("fonts/arial.ttf");
MenuItemFont::setFontSize(24);
for (int i = 0; i < g_maxTests; ++i)
{
@ -348,7 +348,7 @@ void CocosGUITestScene::onEnter()
{
Scene::onEnter();
LabelTTF* label = CCLabelTTF::create("Back", "Arial", 20);
auto label = Label::create("Back", "fonts/arial.ttf", 20);
//#endif
auto pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CocosGUITestScene::BackCallback, this));
@ -405,7 +405,7 @@ void CocosGUITestScene::runThisTest()
_itemMenu = Menu::create();
_itemMenu->setPosition(Point::ZERO);
MenuItemFont::setFontName("Arial");
MenuItemFont::setFontName("fonts/arial.ttf");
MenuItemFont::setFontSize(24);
for (int i = 0; i < sizeof(gui_scene_names) / sizeof(gui_scene_names[0]); ++i)
{

View File

@ -58,7 +58,7 @@ void CustomGUITestMainLayer::onEnter()
_itemMenu = Menu::create();
_itemMenu->setPosition( _curPos );
MenuItemFont::setFontName("Arial");
MenuItemFont::setFontName("fonts/arial.ttf");
MenuItemFont::setFontSize(24);
for (int i = 0; i < g_maxTests; ++i)
{
@ -118,7 +118,7 @@ void CustomGUITestScene::onEnter()
{
CCScene::onEnter();
LabelTTF* label = LabelTTF::create("Back", "Arial", 20);
auto label = Label::create("Back", "fonts/arial.ttf", 20);
//#endif
MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CustomGUITestScene::BackCallback, this));

View File

@ -36,7 +36,7 @@ void CustomImageScene::onEnter()
{
CCScene::onEnter();
LabelTTF* label = LabelTTF::create("Back", "Arial", 20);
auto label = Label::create("Back", "fonts/arial.ttf", 20);
//#endif
MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CustomImageScene::BackCallback, this));

View File

@ -50,7 +50,7 @@ void CustomParticleWidgetScene::onEnter()
addChild(pLayer);
pLayer->release();
LabelTTF* label = LabelTTF::create("Back", "Arial", 20);
auto label = Label::create("Back", "fonts/arial.ttf", 20);
//#endif
MenuItemLabel* pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(CustomParticleWidgetScene::BackCallback, this));

View File

@ -47,7 +47,7 @@ void CustomImageView::initRenderer()
{
ImageView::initRenderer();
_label = LabelTTF::create();
_label = Label::create();
CCNodeRGBA::addChild(_label, getLocalZOrder() + 1, -1);
}

View File

@ -22,7 +22,7 @@ protected:
virtual void initRenderer() override;
protected:
cocos2d::LabelTTF* _label;
cocos2d::Label* _label;
};
#endif /* defined(__TestCpp__CustomImageView__) */

View File

@ -271,7 +271,7 @@ void GUIEditorMainLayer::onEnter()
_itemMenu = Menu::create();
_itemMenu->setPosition( s_tCurPos );
MenuItemFont::setFontName("Arial");
MenuItemFont::setFontName("fonts/arial.ttf");
MenuItemFont::setFontSize(24);
for (int i = 0; i < g_maxTests; ++i)
{
@ -333,7 +333,7 @@ void GUIEditorTestScene::onEnter()
{
Scene::onEnter();
LabelTTF* label = LabelTTF::create("Back", "Arial", 20);
auto label = Label::create("Back", "fonts/arial.ttf", 20);
auto pMenuItem = MenuItemLabel::create(label, CC_CALLBACK_1(GUIEditorTestScene::BackCallback, this));

View File

@ -23,7 +23,7 @@ bool UIButtonTest::init()
// Add a label in which the button events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
@ -32,7 +32,7 @@ bool UIButtonTest::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Button");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
@ -99,7 +99,7 @@ bool UIButtonTest_Scale9::init()
// Add a label in which the button events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
@ -108,7 +108,7 @@ bool UIButtonTest_Scale9::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Button scale9 render");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));
@ -174,7 +174,7 @@ bool UIButtonTest_PressedAction::init()
// Add a label in which the button events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
@ -183,7 +183,7 @@ bool UIButtonTest_PressedAction::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Button Pressed Action");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
@ -249,7 +249,7 @@ bool UIButtonTest_Title::init()
// Add a label in which the text button events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
@ -258,7 +258,7 @@ bool UIButtonTest_Title::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Button with title");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));

View File

@ -44,7 +44,7 @@ bool UIButtonTest_Editor::init()
scale9_button->addTouchEventListener(this, toucheventselector(UIButtonTest_Editor::touchEvent));
_displayValueLabel = Text::create();
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(30);
_displayValueLabel->setText("No event");
_displayValueLabel->setPosition(Point(_layout->getSize().width / 2,

View File

@ -23,7 +23,7 @@ bool UICheckBoxTest::init()
// Add a label in which the checkbox events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
@ -32,7 +32,7 @@ bool UICheckBoxTest::init()
// Add the alert
Text* alert = Text::create();
alert->setText("CheckBox");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));

View File

@ -38,7 +38,7 @@ bool UICheckBoxTest_Editor::init()
checkbox->addEventListenerCheckBox(this, checkboxselectedeventselector(UICheckBoxTest_Editor::selectedStateEvent));
_displayValueLabel = Text::create();
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(30);
_displayValueLabel->setText("No event");
_displayValueLabel->setPosition(Point(_layout->getSize().width / 2,

View File

@ -13,7 +13,7 @@ bool UIImageViewTest::init()
Text* alert = Text::create();
alert->setText("ImageView");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));
@ -74,7 +74,7 @@ bool UIImageViewTest_Scale9::init()
Text* alert = Text::create();
alert->setText("ImageView scale9 render");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(26);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.125f));

View File

@ -22,7 +22,7 @@ bool UILayoutTest::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -88,7 +88,7 @@ bool UILayoutTest_Color::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout color render");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -155,7 +155,7 @@ bool UILayoutTest_Gradient::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout gradient render");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -222,7 +222,7 @@ bool UILayoutTest_BackGroundImage::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout background image");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f));
@ -289,7 +289,7 @@ bool UILayoutTest_BackGroundImage_Scale9::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout background image scale9");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f));
@ -356,7 +356,7 @@ bool UILayoutTest_Layout_Linear_Vertical::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout Linear Vertical");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f));
@ -441,7 +441,7 @@ bool UILayoutTest_Layout_Linear_Horizontal::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout Linear Horizontal");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f));
@ -526,7 +526,7 @@ bool UILayoutTest_Layout_Relative_Align_Parent::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout Relative Align Parent");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f));
@ -675,7 +675,7 @@ bool UILayoutTest_Layout_Relative_Location::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout Relative Location");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f));
@ -779,7 +779,7 @@ bool UILayoutTest_Layout_Grid::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Layout Grid");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5f));

View File

@ -2,12 +2,7 @@
#include "UIListViewTest.h"
const char* font_UIListViewTest =
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
"Marker Felt";
#else
"cocosui/Marker Felt.ttf";
#endif
const char* font_UIListViewTest = "fonts/Marker Felt.ttf";
// UIListViewTest_Vertical
@ -31,7 +26,7 @@ bool UIListViewTest_Vertical::init()
_displayValueLabel = Text::create();
_displayValueLabel->setText("Move by vertical direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f));
@ -40,7 +35,7 @@ bool UIListViewTest_Vertical::init()
Text* alert = Text::create();
alert->setText("ListView vertical");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -216,7 +211,7 @@ bool UIListViewTest_Horizontal::init()
_displayValueLabel = Text::create();
_displayValueLabel->setText("Move by horizontal direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f));
@ -225,7 +220,7 @@ bool UIListViewTest_Horizontal::init()
Text* alert = Text::create();
alert->setText("ListView horizontal");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));

View File

@ -27,7 +27,7 @@ bool UILoadingBarTest_Left::init()
// Add the alert
Text* alert = Text::create();
alert->setText("LoadingBar left");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));
@ -109,7 +109,7 @@ bool UILoadingBarTest_Right::init()
// Add the alert
Text *alert = Text::create();
alert->setText("LoadingBar right");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));
@ -192,7 +192,7 @@ bool UILoadingBarTest_Left_Scale9::init()
// Add the alert
Text* alert = Text::create();
alert->setText("LoadingBar left scale9 render");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.7f));
@ -277,7 +277,7 @@ bool UILoadingBarTest_Right_Scale9::init()
// Add the alert
Text *alert = Text::create();
alert->setText("LoadingBar right scale9 render");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 2.7f));

View File

@ -23,7 +23,7 @@ bool UIPageViewTest::init()
// Add a label in which the dragpanel events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("Move by horizontal direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5));
@ -32,7 +32,7 @@ bool UIPageViewTest::init()
// Add the black background
Text* alert = Text::create();
alert->setText("PageView");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -67,7 +67,7 @@ bool UIPageViewTest::init()
Text* label = Text::create();
label->setText(CCString::createWithFormat("page %d", (i + 1))->getCString());
label->setFontName("Marker Felt");
label->setFontName("fonts/Marker Felt.ttf");
label->setFontSize(30);
label->setColor(Color3B(192, 192, 192));
label->setPosition(Point(layout->getSize().width / 2.0f, layout->getSize().height / 2.0f));

View File

@ -23,7 +23,7 @@ bool UIRichTextTest::init()
// Add the alert
Text *alert = Text::create();
alert->setText("RichText");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.125));

View File

@ -23,7 +23,7 @@ bool UIScrollViewTest_Vertical::init()
// Add a label in which the scrollview alert will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("Move by vertical direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f));
@ -32,7 +32,7 @@ bool UIScrollViewTest_Vertical::init()
// Add the alert
Text* alert = Text::create();
alert->setText("ScrollView vertical");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -111,7 +111,7 @@ bool UIScrollViewTest_Horizontal::init()
// Add a label in which the scrollview alert will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("Move by horizontal direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getContentSize().height * 1.5f));
@ -119,7 +119,7 @@ bool UIScrollViewTest_Horizontal::init()
Text* alert = Text::create();
alert->setText("ScrollView horizontal");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -205,7 +205,7 @@ bool UIScrollViewTest_Both::init()
// Add a label in which the dragpanel events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("Move by any direction");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f));
@ -214,7 +214,7 @@ bool UIScrollViewTest_Both::init()
// Add the alert
Text* alert = Text::create();
alert->setText("ScrollView both");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -274,7 +274,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init()
// Add a label in which the dragpanel events will be displayed
_displayValueLabel = Text::create();
// _displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f));
@ -283,7 +283,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection::init()
// Add the alert
Text* alert = Text::create();
alert->setText("ScrollView scroll to percent both directrion");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5));
@ -336,7 +336,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init()
// Add a label in which the dragpanel events will be displayed
_displayValueLabel = Text::create();
// _displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f));
@ -345,7 +345,7 @@ bool UIScrollViewTest_ScrollToPercentBothDirection_Bounce::init()
// Add the alert
Text* alert = Text::create();
alert->setText("ScrollView scroll to percent both directrion bounce");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(20);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 4.5));

View File

@ -24,7 +24,7 @@ bool UISliderTest::init()
// Add a label in which the slider alert will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("Move the slider thumb");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
@ -33,7 +33,7 @@ bool UISliderTest::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Slider");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));
@ -99,7 +99,7 @@ bool UISliderTest_Scale9::init()
// Add a label in which the slider alert will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("Move the slider thumb");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
@ -108,7 +108,7 @@ bool UISliderTest_Scale9::init()
// Add the alert
Text *alert = Text::create();
alert->setText("Slider scale9 render");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));

View File

@ -43,7 +43,7 @@ bool UISliderTest_Editor::init()
_displayValueLabel = Text::create();
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(30);
_displayValueLabel->setText("No event");
_displayValueLabel->setPosition(Point(_layout->getSize().width / 2,

View File

@ -14,7 +14,7 @@ bool UITextAtlasTest::init()
// Add the alert
Text* alert = Text::create();
alert->setText("TextAtlas");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));

View File

@ -13,7 +13,7 @@ bool UITextBMFontTest::init()
Text* alert = Text::create();
alert->setText("TextBMFont");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));

View File

@ -22,7 +22,7 @@ bool UITextFieldTest::init()
// Add a label in which the textfield events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f));
@ -31,7 +31,7 @@ bool UITextFieldTest::init()
// Add the alert
Text* alert = Text::create();
alert->setText("TextField");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -40,7 +40,7 @@ bool UITextFieldTest::init()
// Create the textfield
TextField* textField = TextField::create();
textField->setTouchEnabled(true);
textField->setFontName("Marker Felt");
textField->setFontName("fonts/Marker Felt.ttf");
textField->setFontSize(30);
textField->setPlaceHolder("input words here");
textField->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
@ -111,7 +111,7 @@ bool UITextFieldTest_MaxLength::init()
// Add a label in which the textfield events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(screenSize.width / 2.0f, screenSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f));
@ -120,7 +120,7 @@ bool UITextFieldTest_MaxLength::init()
// Add the alert
Text *alert = Text::create();
alert->setText("TextField max length");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(screenSize.width / 2.0f, screenSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -131,7 +131,7 @@ bool UITextFieldTest_MaxLength::init()
textField->setMaxLengthEnabled(true);
textField->setMaxLength(3);
textField->setTouchEnabled(true);
textField->setFontName("Marker Felt");
textField->setFontName("fonts/Marker Felt.ttf");
textField->setFontSize(30);
textField->setPlaceHolder("input words here");
textField->setPosition(Point(screenSize.width / 2.0f, screenSize.height / 2.0f));
@ -205,7 +205,7 @@ bool UITextFieldTest_Password::init()
// Add a label in which the textfield events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(32);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(screenSize.width / 2.0f, screenSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5f));
@ -214,7 +214,7 @@ bool UITextFieldTest_Password::init()
// Add the alert
Text *alert = Text::create();
alert->setText("TextField password");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(screenSize.width / 2.0f, screenSize.height / 2.0f - alert->getSize().height * 3.075f));
@ -225,7 +225,7 @@ bool UITextFieldTest_Password::init()
textField->setPasswordEnabled(true);
textField->setPasswordStyleText("*");
textField->setTouchEnabled(true);
textField->setFontName("Marker Felt");
textField->setFontName("fonts/Marker Felt.ttf");
textField->setFontSize(30);
textField->setPlaceHolder("input password here");
textField->setPosition(Point(screenSize.width / 2.0f, screenSize.height / 2.0f));
@ -294,7 +294,7 @@ bool UITextFieldTest_LineWrap::init()
// Add a label in which the textfield events will be displayed
_displayValueLabel = Text::create();
_displayValueLabel->setText("No Event");
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(30);
_displayValueLabel->setAnchorPoint(Point(0.5f, -1));
_displayValueLabel->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f + _displayValueLabel->getSize().height * 1.5));
@ -303,7 +303,7 @@ bool UITextFieldTest_LineWrap::init()
// Add the alert
Text *alert = Text::create();
alert->setText("TextField line wrap");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.075));
@ -316,7 +316,7 @@ bool UITextFieldTest_LineWrap::init()
textField->setTextHorizontalAlignment(TextHAlignment::CENTER);
textField->setTextVerticalAlignment(TextVAlignment::CENTER);
textField->setTouchEnabled(true);
textField->setFontName("Marker Felt");
textField->setFontName("fonts/Marker Felt.ttf");
textField->setFontSize(30);
textField->setPlaceHolder("input words here");
textField->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));

View File

@ -44,7 +44,7 @@ bool UITextFieldTest_Editor::init()
textField_password->addEventListenerTextField(this, textfieldeventselector(UITextFieldTest_Editor::textFieldEvent));
_displayValueLabel = Text::create();
_displayValueLabel->setFontName("Marker Felt");
_displayValueLabel->setFontName("fonts/Marker Felt.ttf");
_displayValueLabel->setFontSize(30);
_displayValueLabel->setText("No event");
_displayValueLabel->setPosition(Point(_layout->getSize().width / 2,

View File

@ -13,7 +13,7 @@ bool UITextTest::init()
Text* alert = Text::create();
alert->setText("Text");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));
@ -42,7 +42,7 @@ bool UITextTest_LineWrap::init()
Text* alert = Text::create();
alert->setText("Text line wrap");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));
@ -74,7 +74,7 @@ bool UILabelTest_Effect::init()
Text* alert = Text::create();
alert->setText("Label Effect");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 3.05f));
@ -89,7 +89,7 @@ bool UILabelTest_Effect::init()
FontDefinition shadowTextDef;
shadowTextDef._fontSize = 20;
shadowTextDef._fontName = std::string("Marker Felt");
shadowTextDef._fontName = std::string("fonts/Marker Felt.ttf");
shadowTextDef._shadow._shadowEnabled = true;
shadowTextDef._shadow._shadowOffset = shadowOffset;
@ -112,7 +112,7 @@ bool UILabelTest_Effect::init()
FontDefinition strokeTextDef;
strokeTextDef._fontSize = 20;
strokeTextDef._fontName = std::string("Marker Felt");
strokeTextDef._fontName = std::string("fonts/Marker Felt.ttf");
strokeTextDef._stroke._strokeEnabled = true;
strokeTextDef._stroke._strokeColor = strokeColor;
@ -135,7 +135,7 @@ bool UILabelTest_Effect::init()
FontDefinition strokeShaodwTextDef;
strokeShaodwTextDef._fontSize = 20;
strokeShaodwTextDef._fontName = std::string("Marker Felt");
strokeShaodwTextDef._fontName = std::string("fonts/Marker Felt.ttf");
strokeShaodwTextDef._stroke._strokeEnabled = true;
strokeShaodwTextDef._stroke._strokeColor = strokeShadowColor;
@ -172,7 +172,7 @@ bool UITextTest_TTF::init()
Text* alert = Text::create();
alert->setText("Text set TTF font");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));

View File

@ -23,7 +23,7 @@ bool UIWidgetAddNodeTest::init()
// Add the alert
Text* alert = Text::create();
alert->setText("Widget Add Node");
alert->setFontName("Marker Felt");
alert->setFontName("fonts/Marker Felt.ttf");
alert->setFontSize(30);
alert->setColor(Color3B(159, 168, 176));
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75));

View File

@ -114,16 +114,16 @@ void SceneEditorTestLayer::onEnter()
// add title and subtitle
std::string str = title();
const char *pTitle = str.c_str();
LabelTTF *label = LabelTTF::create(pTitle, "Arial", 18);
label->setColor(Color3B(255, 255, 255));
auto label = Label::create(pTitle, "fonts/arial.ttf", 18);
label->setTextColor(Color4B::WHITE);
addChild(label, 1, 10000);
label->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 30) );
std::string strSubtitle = subtitle();
if( ! strSubtitle.empty() )
{
LabelTTF *l = LabelTTF::create(strSubtitle.c_str(), "Arial", 18);
l->setColor(Color3B(0, 0, 0));
auto l = Label::create(strSubtitle.c_str(), "fonts/arial.ttf", 18);
l->setTextColor(Color4B::BLACK);
addChild(l, 1, 10001);
l->setPosition(Point(VisibleRect::center().x, VisibleRect::top().y - 60) );
}

View File

@ -94,7 +94,7 @@ ControlButton *ControlButtonTest_HelloVariableSize::standardButtonWithTitle(cons
auto backgroundButton = Scale9Sprite::create("extensions/button.png");
auto backgroundHighlightedButton = Scale9Sprite::create("extensions/buttonHighlighted.png");
auto titleButton = LabelTTF::create(title, "Marker Felt", 30);
auto titleButton = Label::create(title, "fonts/Marker Felt.ttf", 30);
titleButton->setColor(Color3B(159, 168, 176));
@ -125,12 +125,12 @@ bool ControlButtonTest_Event::init()
auto screenSize = Director::getInstance()->getWinSize();
// Add a label in which the button events will be displayed
setDisplayValueLabel(LabelTTF::create("No Event", "Marker Felt", 32));
setDisplayValueLabel(Label::create("No Event", "fonts/Marker Felt.ttf", 32));
_displayValueLabel->setAnchorPoint(Point(0.5f, -1));
_displayValueLabel->setPosition(Point(screenSize.width / 2.0f, screenSize.height / 2.0f));
addChild(_displayValueLabel, 1);
setDisplayBitmaskLabel(LabelTTF::create("No bitmask event", "Marker Felt", 24));
setDisplayBitmaskLabel(Label::create("No bitmask event", "fonts/Marker Felt.ttf", 24));
_displayBitmaskLabel->setAnchorPoint(Point(0.5f, -1));
Point bitmaskLabelPos = _displayValueLabel->getPosition() - Point(0, _displayBitmaskLabel->getBoundingBox().size.height);
_displayBitmaskLabel->setPosition(bitmaskLabelPos);
@ -140,7 +140,7 @@ bool ControlButtonTest_Event::init()
auto backgroundButton = Scale9Sprite::create("extensions/button.png");
auto backgroundHighlightedButton = Scale9Sprite::create("extensions/buttonHighlighted.png");
auto titleButton = LabelTTF::create("Touch Me!", "Marker Felt", 30);
auto titleButton = Label::create("Touch Me!", "fonts/Marker Felt.ttf", 30);
titleButton->setColor(Color3B(159, 168, 176));
@ -278,7 +278,7 @@ ControlButton *ControlButtonTest_Styling::standardButtonWithTitle(const char *ti
auto backgroundHighlightedButton = Scale9Sprite::create("extensions/buttonHighlighted.png");
backgroundHighlightedButton->setPreferredSize(Size(45, 45)); // Set the prefered size
auto titleButton = LabelTTF::create(title, "Marker Felt", 30);
auto titleButton = Label::create(title, "fonts/Marker Felt.ttf", 30);
titleButton->setColor(Color3B(159, 168, 176));

View File

@ -56,8 +56,8 @@ public:
void touchCancelAction(Ref *sender, Control::EventType controlEvent);
void touchBitmaskAction(Ref *sender, Control::EventType controlEvent);
protected:
CC_SYNTHESIZE_RETAIN(LabelTTF *, _displayValueLabel, DisplayValueLabel)
CC_SYNTHESIZE_RETAIN(LabelTTF *, _displayBitmaskLabel, DisplayBitmaskLabel)
CC_SYNTHESIZE_RETAIN(Label *, _displayValueLabel, DisplayValueLabel)
CC_SYNTHESIZE_RETAIN(Label *, _displayBitmaskLabel, DisplayBitmaskLabel)
CONTROL_SCENE_CREATE_FUNC(ControlButtonTest_Event)
};

View File

@ -66,7 +66,7 @@ bool ControlColourPickerTest::init()
layer_width += background->getContentSize().width;
_colorLabel = LabelTTF::create("#color", "Marker Felt", 30);
_colorLabel = Label::create("#color", "fonts/Marker Felt.ttf", 30);
_colorLabel->retain();
_colorLabel->setPosition(background->getPosition());

View File

@ -37,7 +37,7 @@ public:
/** Callback for the change value. */
void colourValueChanged(Ref *sender, Control::EventType controlEvent);
CC_SYNTHESIZE_RETAIN(LabelTTF*, _colorLabel, ColorLabel)
CC_SYNTHESIZE_RETAIN(Label*, _colorLabel, ColorLabel)
CONTROL_SCENE_CREATE_FUNC(ControlColourPickerTest)
};

View File

@ -55,7 +55,7 @@ bool ControlPotentiometerTest::init()
layer_width += background->getContentSize().width;
this->setDisplayValueLabel(LabelTTF::create("", "HelveticaNeue-Bold", 30));
this->setDisplayValueLabel(Label::create("", "HelveticaNeue-Bold", 30));
_displayValueLabel->setPosition(background->getPosition());
layer->addChild(_displayValueLabel);

View File

@ -33,7 +33,7 @@ public:
ControlPotentiometerTest();
virtual ~ControlPotentiometerTest();
bool init();
CC_SYNTHESIZE_RETAIN(LabelTTF*, _displayValueLabel, DisplayValueLabel)
CC_SYNTHESIZE_RETAIN(Label*, _displayValueLabel, DisplayValueLabel)
void valueChanged(Ref *sender, Control::EventType controlEvent);

View File

@ -60,7 +60,7 @@ bool ControlScene::init()
addChild(ribbon);
// Add the title
setSceneTitleLabel(LabelTTF::create("Title", "Arial", 12));
setSceneTitleLabel(Label::create("Title", "fonts/arial.ttf", 12));
_sceneTitleLabel->setPosition(Point (VisibleRect::center().x, VisibleRect::top().y - _sceneTitleLabel->getContentSize().height / 2 - 5));
addChild(_sceneTitleLabel, 1);

View File

@ -66,7 +66,7 @@ public:
void nextCallback(Ref* sender);
/** Title label of the scene. */
CC_SYNTHESIZE_RETAIN(LabelTTF*, _sceneTitleLabel, SceneTitleLabel)
CC_SYNTHESIZE_RETAIN(Label*, _sceneTitleLabel, SceneTitleLabel)
CONTROL_SCENE_CREATE_FUNC(ControlScene);
};

View File

@ -43,7 +43,7 @@ bool ControlSliderTest::init()
auto screenSize = Director::getInstance()->getWinSize();
// Add a label in which the slider value will be displayed
_displayValueLabel = LabelTTF::create("Move the slider thumb!\nThe lower slider is restricted." ,"Marker Felt", 32);
_displayValueLabel = Label::create("Move the slider thumb!\nThe lower slider is restricted." ,"fonts/Marker Felt.ttf", 32);
_displayValueLabel->retain();
_displayValueLabel->setAnchorPoint(Point(0.5f, -1.0f));
_displayValueLabel->setPosition(Point(screenSize.width / 1.7f, screenSize.height / 2.0f));

View File

@ -33,7 +33,7 @@ public:
bool init();
void valueChanged(Ref *sender, Control::EventType controlEvent);
protected:
LabelTTF* _displayValueLabel;
Label* _displayValueLabel;
CONTROL_SCENE_CREATE_FUNC(ControlSliderTest)
};

View File

@ -54,7 +54,7 @@ bool ControlStepperTest::init()
background->setPosition(Point(layer_width + background->getContentSize().width / 2.0f, 0));
layer->addChild(background);
this->setDisplayValueLabel(LabelTTF::create("0", "HelveticaNeue-Bold", 30));
this->setDisplayValueLabel(Label::create("0", "HelveticaNeue-Bold", 30));
_displayValueLabel->setPosition(background->getPosition());
layer->addChild(_displayValueLabel);

View File

@ -40,7 +40,7 @@ public:
/** Callback for the change value. */
void valueChanged(Ref *sender, Control::EventType controlEvent);
protected:
CC_SYNTHESIZE_RETAIN(LabelTTF*, _displayValueLabel, DisplayValueLabel)
CC_SYNTHESIZE_RETAIN(Label*, _displayValueLabel, DisplayValueLabel)
CONTROL_SCENE_CREATE_FUNC(ControlStepperTest)
};

View File

@ -51,7 +51,7 @@ bool ControlSwitchTest::init()
layer_width += background->getContentSize().width;
_displayValueLabel = LabelTTF::create("#color" ,"Marker Felt" ,30);
_displayValueLabel = Label::create("#color" ,"fonts/Marker Felt.ttf" ,30);
_displayValueLabel->retain();
_displayValueLabel->setPosition(background->getPosition());

View File

@ -33,7 +33,7 @@ public:
bool init();
/** Callback for the change value. */
void valueChanged(Ref* sender, Control::EventType controlEvent);
LabelTTF *_displayValueLabel;
Label *_displayValueLabel;
CONTROL_SCENE_CREATE_FUNC(ControlSwitchTest)
};

View File

@ -23,7 +23,7 @@ EditBoxTest::EditBoxTest()
pBg->setPosition(Point(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2));
addChild(pBg);
_TTFShowEditReturn = LabelTTF::create("No edit control return!", "", 30);
_TTFShowEditReturn = Label::create("No edit control return!", "", 30);
_TTFShowEditReturn->setPosition(Point(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y + visibleSize.height - 50));
addChild(_TTFShowEditReturn);

View File

@ -24,7 +24,7 @@ public:
virtual void editBoxTextChanged(cocos2d::extension::EditBox* editBox, const std::string& text);
virtual void editBoxReturn(cocos2d::extension::EditBox* editBox);
private:
cocos2d::LabelTTF* _TTFShowEditReturn;
cocos2d::Label* _TTFShowEditReturn;
cocos2d::extension::EditBox* _editName;
cocos2d::extension::EditBox* _editPassword;
cocos2d::extension::EditBox* _editEmail;

View File

@ -112,7 +112,7 @@ void ExtensionsMainLayer::onEnter()
_itemMenu = Menu::create();
_itemMenu->setPosition( Point::ZERO );
MenuItemFont::setFontName("Arial");
MenuItemFont::setFontName("fonts/arial.ttf");
MenuItemFont::setFontSize(24);
for (int i = 0; i < g_maxTests; ++i)
{

View File

@ -14,7 +14,7 @@ HttpClientTest::HttpClientTest()
const int MARGIN = 40;
const int SPACE = 35;
auto label = LabelTTF::create("Http Request Test", "Arial", 28);
auto label = Label::create("Http Request Test", "fonts/arial.ttf", 28);
label->setPosition(Point(winSize.width / 2, winSize.height - MARGIN));
addChild(label, 0);
@ -23,37 +23,37 @@ HttpClientTest::HttpClientTest()
addChild(menuRequest);
// Get
auto labelGet = LabelTTF::create("Test Get", "Arial", 22);
auto labelGet = Label::create("Test Get", "fonts/arial.ttf", 22);
auto itemGet = MenuItemLabel::create(labelGet, CC_CALLBACK_1(HttpClientTest::onMenuGetTestClicked, this));
itemGet->setPosition(Point(winSize.width / 2, winSize.height - MARGIN - SPACE));
menuRequest->addChild(itemGet);
// Post
auto labelPost = LabelTTF::create("Test Post", "Arial", 22);
auto labelPost = Label::create("Test Post", "fonts/arial.ttf", 22);
auto itemPost = MenuItemLabel::create(labelPost, CC_CALLBACK_1(HttpClientTest::onMenuPostTestClicked, this));
itemPost->setPosition(Point(winSize.width / 2, winSize.height - MARGIN - 2 * SPACE));
menuRequest->addChild(itemPost);
// Post Binary
auto labelPostBinary = LabelTTF::create("Test Post Binary", "Arial", 22);
auto labelPostBinary = Label::create("Test Post Binary", "fonts/arial.ttf", 22);
auto itemPostBinary = MenuItemLabel::create(labelPostBinary, CC_CALLBACK_1(HttpClientTest::onMenuPostBinaryTestClicked, this));
itemPostBinary->setPosition(Point(winSize.width / 2, winSize.height - MARGIN - 3 * SPACE));
menuRequest->addChild(itemPostBinary);
// Put
auto labelPut = LabelTTF::create("Test Put", "Arial", 22);
auto labelPut = Label::create("Test Put", "fonts/arial.ttf", 22);
auto itemPut = MenuItemLabel::create(labelPut, CC_CALLBACK_1(HttpClientTest::onMenuPutTestClicked, this));
itemPut->setPosition(Point(winSize.width / 2, winSize.height - MARGIN - 4 * SPACE));
menuRequest->addChild(itemPut);
// Delete
auto labelDelete = LabelTTF::create("Test Delete", "Arial", 22);
auto labelDelete = Label::create("Test Delete", "fonts/arial.ttf", 22);
auto itemDelete = MenuItemLabel::create(labelDelete, CC_CALLBACK_1(HttpClientTest::onMenuDeleteTestClicked, this));
itemDelete->setPosition(Point(winSize.width / 2, winSize.height - MARGIN - 5 * SPACE));
menuRequest->addChild(itemDelete);
// Response Code Label
_labelStatusCode = LabelTTF::create("HTTP Status Code", "Marker Felt", 20);
_labelStatusCode = Label::create("HTTP Status Code", "fonts/arial.ttf", 22);
_labelStatusCode->setPosition(Point(winSize.width / 2, winSize.height - MARGIN - 6 * SPACE));
addChild(_labelStatusCode);

View File

@ -23,7 +23,7 @@ public:
void onHttpRequestCompleted(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response);
private:
cocos2d::LabelTTF* _labelStatusCode;
cocos2d::Label* _labelStatusCode;
};
void runHttpClientTest();

View File

@ -25,7 +25,7 @@ SocketIOTestLayer::SocketIOTestLayer(void)
const int MARGIN = 40;
const int SPACE = 35;
auto label = LabelTTF::create("SocketIO Extension Test", "Arial", 28);
auto label = Label::create("SocketIO Extension Test", "fonts/arial.ttf", 28);
label->setPosition(Point(winSize.width / 2, winSize.height - MARGIN));
addChild(label, 0);
@ -34,55 +34,55 @@ SocketIOTestLayer::SocketIOTestLayer(void)
addChild(menuRequest);
// Test to create basic client in the default namespace
auto labelSIOClient = LabelTTF::create("Open SocketIO Client", "Arial", 22);
auto labelSIOClient = Label::create("Open SocketIO Client", "fonts/arial.ttf", 22);
auto itemSIOClient = MenuItemLabel::create(labelSIOClient, CC_CALLBACK_1(SocketIOTestLayer::onMenuSIOClientClicked, this));
itemSIOClient->setPosition(Point(VisibleRect::left().x + labelSIOClient->getContentSize().width / 2 + 5, winSize.height - MARGIN - SPACE));
menuRequest->addChild(itemSIOClient);
// Test to create a client at the endpoint '/testpoint'
auto labelSIOEndpoint = LabelTTF::create("Open SocketIO Endpoint", "Arial", 22);
auto labelSIOEndpoint = Label::create("Open SocketIO Endpoint", "fonts/arial.ttf", 22);
auto itemSIOEndpoint = MenuItemLabel::create(labelSIOEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuSIOEndpointClicked, this));
itemSIOEndpoint->setPosition(Point(VisibleRect::right().x - labelSIOEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - SPACE));
menuRequest->addChild(itemSIOEndpoint);
// Test sending message to default namespace
auto labelTestMessage = LabelTTF::create("Send Test Message", "Arial", 22);
auto labelTestMessage = Label::create("Send Test Message", "fonts/arial.ttf", 22);
auto itemTestMessage = MenuItemLabel::create(labelTestMessage, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestMessageClicked, this));
itemTestMessage->setPosition(Point(VisibleRect::left().x + labelTestMessage->getContentSize().width / 2 + 5, winSize.height - MARGIN - 2 * SPACE));
menuRequest->addChild(itemTestMessage);
// Test sending message to the endpoint '/testpoint'
auto labelTestMessageEndpoint = LabelTTF::create("Test Endpoint Message", "Arial", 22);
auto labelTestMessageEndpoint = Label::create("Test Endpoint Message", "fonts/arial.ttf", 22);
auto itemTestMessageEndpoint = MenuItemLabel::create(labelTestMessageEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestMessageEndpointClicked, this));
itemTestMessageEndpoint->setPosition(Point(VisibleRect::right().x - labelTestMessageEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 2 * SPACE));
menuRequest->addChild(itemTestMessageEndpoint);
// Test sending event 'echotest' to default namespace
auto labelTestEvent = LabelTTF::create("Send Test Event", "Arial", 22);
auto labelTestEvent = Label::create("Send Test Event", "fonts/arial.ttf", 22);
auto itemTestEvent = MenuItemLabel::create(labelTestEvent, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEventClicked, this));
itemTestEvent->setPosition(Point(VisibleRect::left().x + labelTestEvent->getContentSize().width / 2 + 5, winSize.height - MARGIN - 3 * SPACE));
menuRequest->addChild(itemTestEvent);
// Test sending event 'echotest' to the endpoint '/testpoint'
auto labelTestEventEndpoint = LabelTTF::create("Test Endpoint Event", "Arial", 22);
auto labelTestEventEndpoint = Label::create("Test Endpoint Event", "fonts/arial.ttf", 22);
auto itemTestEventEndpoint = MenuItemLabel::create(labelTestEventEndpoint, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEventEndpointClicked, this));
itemTestEventEndpoint->setPosition(Point(VisibleRect::right().x - labelTestEventEndpoint->getContentSize().width / 2 - 5, winSize.height - MARGIN - 3 * SPACE));
menuRequest->addChild(itemTestEventEndpoint);
// Test disconnecting basic client
auto labelTestClientDisconnect = LabelTTF::create("Disconnect Socket", "Arial", 22);
auto labelTestClientDisconnect = Label::create("Disconnect Socket", "fonts/arial.ttf", 22);
auto itemClientDisconnect = MenuItemLabel::create(labelTestClientDisconnect, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestClientDisconnectClicked, this));
itemClientDisconnect->setPosition(Point(VisibleRect::left().x + labelTestClientDisconnect->getContentSize().width / 2 + 5, winSize.height - MARGIN - 4 * SPACE));
menuRequest->addChild(itemClientDisconnect);
// Test disconnecting the endpoint '/testpoint'
auto labelTestEndpointDisconnect = LabelTTF::create("Disconnect Endpoint", "Arial", 22);
auto labelTestEndpointDisconnect = Label::create("Disconnect Endpoint", "fonts/arial.ttf", 22);
auto itemTestEndpointDisconnect = MenuItemLabel::create(labelTestEndpointDisconnect, CC_CALLBACK_1(SocketIOTestLayer::onMenuTestEndpointDisconnectClicked, this));
itemTestEndpointDisconnect->setPosition(Point(VisibleRect::right().x - labelTestEndpointDisconnect->getContentSize().width / 2 - 5, winSize.height - MARGIN - 4 * SPACE));
menuRequest->addChild(itemTestEndpointDisconnect);
// Sahred Status Label
_sioClientStatus = LabelTTF::create("Not connected...", "Arial", 14, Size(320, 100), TextHAlignment::LEFT);
_sioClientStatus = Label::create("Not connected...", "fonts/arial.ttf", 14, Size(320, 100), TextHAlignment::LEFT);
_sioClientStatus->setAnchorPoint(Point(0, 0));
_sioClientStatus->setPosition(Point(VisibleRect::left().x, VisibleRect::rightBottom().y));
this->addChild(_sioClientStatus);

View File

@ -43,7 +43,7 @@ public:
cocos2d::network::SIOClient *_sioClient, *_sioEndpoint;
cocos2d::LabelTTF *_sioClientStatus;
cocos2d::Label *_sioClientStatus;
};
void runSocketIOTest();

Some files were not shown because too many files have changed in this diff Show More