diff --git a/CHANGELOG.REMOVED.git-id b/CHANGELOG.REMOVED.git-id index 3d57132a8f..2060ec905d 100644 --- a/CHANGELOG.REMOVED.git-id +++ b/CHANGELOG.REMOVED.git-id @@ -1 +1 @@ -24725aaaf53bbf506d1ea378c6af1d9ff1e61c12 \ No newline at end of file +63f931258263a5cf78f2e7d478324a57ccdc9794 \ No newline at end of file diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index 9198993d21..3ef99242f0 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -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 diff --git a/cocos/2d/CCFontAtlas.h b/cocos/2d/CCFontAtlas.h index a10fe9eb9f..134f360ea3 100644 --- a/cocos/2d/CCFontAtlas.h +++ b/cocos/2d/CCFontAtlas.h @@ -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; }; diff --git a/cocos/2d/CCGLProgram.cpp b/cocos/2d/CCGLProgram.cpp index 6f3bce0f3b..70a5e2d3c5 100644 --- a/cocos/2d/CCGLProgram.cpp +++ b/cocos/2d/CCGLProgram.cpp @@ -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. diff --git a/cocos/2d/CCGLProgram.h b/cocos/2d/CCGLProgram.h index 19c9865f7d..55405a4d45 100644 --- a/cocos/2d/CCGLProgram.h +++ b/cocos/2d/CCGLProgram.h @@ -34,6 +34,7 @@ THE SOFTWARE. #include "CCRef.h" #include "CCGL.h" #include "kazmath/kazmath.h" +#include 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 _freeIDs; + }; + + static MaterialProgramIDAllocator _idAllocator; +public: + static const GLuint _maxMaterialIDNumber; }; // end of shaders group diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 66c58b9eb2..da596b71e2 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -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)); diff --git a/cocos/2d/CCLabel.h b/cocos/2d/CCLabel.h index dcdc6b88f4..01f133cfe0 100644 --- a/cocos/2d/CCLabel.h +++ b/cocos/2d/CCLabel.h @@ -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. */ diff --git a/cocos/2d/CCLayer.cpp b/cocos/2d/CCLayer.cpp index ea79ce6ea5..49ac9275a7 100644 --- a/cocos/2d/CCLayer.cpp +++ b/cocos/2d/CCLayer.cpp @@ -627,9 +627,25 @@ std::string LayerColor::getDescription() const { return StringUtils::format("", _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; diff --git a/cocos/2d/CCLayer.h b/cocos/2d/CCLayer.h index 86443b75c3..fbc4285b70 100644 --- a/cocos/2d/CCLayer.h +++ b/cocos/2d/CCLayer.h @@ -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; diff --git a/cocos/2d/CCTexture2D.cpp b/cocos/2d/CCTexture2D.cpp index 5903f9fd94..e8235d614a 100644 --- a/cocos/2d/CCTexture2D.cpp +++ b/cocos/2d/CCTexture2D.cpp @@ -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 ) diff --git a/cocos/2d/CCTexture2D.h b/cocos/2d/CCTexture2D.h index 1b7fbff0f4..eca4de9f8f 100644 --- a/cocos/2d/CCTexture2D.h +++ b/cocos/2d/CCTexture2D.h @@ -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; }; diff --git a/cocos/2d/renderer/CCQuadCommand.cpp b/cocos/2d/renderer/CCQuadCommand.cpp index 5c75d43665..f4e8317f6e 100644 --- a/cocos/2d/renderer/CCQuadCommand.cpp +++ b/cocos/2d/renderer/CCQuadCommand.cpp @@ -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; } diff --git a/cocos/audio/ios/CDAudioManager.h b/cocos/audio/ios/CDAudioManager.h index af0ab4a98a..96b075431a 100644 --- a/cocos/audio/ios/CDAudioManager.h +++ b/cocos/audio/ios/CDAudioManager.h @@ -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 diff --git a/cocos/audio/ios/CDAudioManager.m b/cocos/audio/ios/CDAudioManager.m index abdf1a8908..beadffa7c8 100644 --- a/cocos/audio/ios/CDAudioManager.m +++ b/cocos/audio/ios/CDAudioManager.m @@ -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) { diff --git a/cocos/audio/mac/CDAudioManager.m b/cocos/audio/mac/CDAudioManager.m index abdf1a8908..18d435e562 100644 --- a/cocos/audio/mac/CDAudioManager.m +++ b/cocos/audio/mac/CDAudioManager.m @@ -119,7 +119,7 @@ NSString * const kCDN_AudioManagerInitialised = @"kCDN_AudioManagerInitialised"; -(void) resume { self->paused = NO; - [audioSourcePlayer play]; + [audioSourcePlayer resume]; } -(BOOL) isPlaying { diff --git a/cocos/audio/mac/CDXMacOSXSupport.h b/cocos/audio/mac/CDXMacOSXSupport.h index 7b85b9a1b3..ccab5531e7 100644 --- a/cocos/audio/mac/CDXMacOSXSupport.h +++ b/cocos/audio/mac/CDXMacOSXSupport.h @@ -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 */ diff --git a/cocos/audio/mac/CDXMacOSXSupport.mm b/cocos/audio/mac/CDXMacOSXSupport.mm index a873c4097a..a84f61debc 100644 --- a/cocos/audio/mac/CDXMacOSXSupport.mm +++ b/cocos/audio/mac/CDXMacOSXSupport.mm @@ -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]; diff --git a/cocos/scripting/lua-bindings/auto/api/Director.lua b/cocos/scripting/lua-bindings/auto/api/Director.lua index 18a77a84f7..be0830afdf 100644 --- a/cocos/scripting/lua-bindings/auto/api/Director.lua +++ b/cocos/scripting/lua-bindings/auto/api/Director.lua @@ -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 diff --git a/cocos/scripting/lua-bindings/auto/api/GLProgram.lua b/cocos/scripting/lua-bindings/auto/api/GLProgram.lua index c2d2b24dcd..9f7f5cf034 100644 --- a/cocos/scripting/lua-bindings/auto/api/GLProgram.lua +++ b/cocos/scripting/lua-bindings/auto/api/GLProgram.lua @@ -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 diff --git a/cocos/scripting/lua-bindings/auto/api/Label.lua b/cocos/scripting/lua-bindings/auto/api/Label.lua index fd8aece932..5eed5109fd 100644 --- a/cocos/scripting/lua-bindings/auto/api/Label.lua +++ b/cocos/scripting/lua-bindings/auto/api/Label.lua @@ -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 diff --git a/cocos/scripting/lua-bindings/auto/api/LayerGradient.lua b/cocos/scripting/lua-bindings/auto/api/LayerGradient.lua index 772dc5fd47..95bc075e72 100644 --- a/cocos/scripting/lua-bindings/auto/api/LayerGradient.lua +++ b/cocos/scripting/lua-bindings/auto/api/LayerGradient.lua @@ -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 diff --git a/cocos/scripting/lua-bindings/auto/api/ProtectedNode.lua b/cocos/scripting/lua-bindings/auto/api/ProtectedNode.lua new file mode 100644 index 0000000000..f9a4615443 --- /dev/null +++ b/cocos/scripting/lua-bindings/auto/api/ProtectedNode.lua @@ -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 diff --git a/cocos/scripting/lua-bindings/auto/api/Texture2D.lua b/cocos/scripting/lua-bindings/auto/api/Texture2D.lua index 27d407e621..0b12bdee27 100644 --- a/cocos/scripting/lua-bindings/auto/api/Texture2D.lua +++ b/cocos/scripting/lua-bindings/auto/api/Texture2D.lua @@ -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 diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua index f35832c385..9d744bb31f 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_auto_api.lua @@ -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 diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp.REMOVED.git-id b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp.REMOVED.git-id index ce6e4ecd48..3953c576eb 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp.REMOVED.git-id +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp.REMOVED.git-id @@ -1 +1 @@ -bb331bf4e55b4ca2f5b12c75e6c3e638ae3367d0 \ No newline at end of file +491f36052e7ee592286d55bcb9b0425b7ca95332 \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp index 5eeff5ebfd..87bbdf1c67 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.hpp @@ -1534,6 +1534,20 @@ int register_all_cocos2dx(lua_State* tolua_S); + + + + + + + + + + + + + + diff --git a/cocos/ui/CCProtectedNode.h b/cocos/ui/CCProtectedNode.h index f2b297d430..df96cd463c 100644 --- a/cocos/ui/CCProtectedNode.h +++ b/cocos/ui/CCProtectedNode.h @@ -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); diff --git a/templates/cocos2dx_files.json.REMOVED.git-id b/templates/cocos2dx_files.json.REMOVED.git-id index c937acbc30..3bc4b1bb9c 100644 --- a/templates/cocos2dx_files.json.REMOVED.git-id +++ b/templates/cocos2dx_files.json.REMOVED.git-id @@ -1 +1 @@ -8cce920bd091a03ab1e10db03eb397451b0d70c5 \ No newline at end of file +7eeab29cb8dd0daa3e3868c60088dcabda899dae \ No newline at end of file diff --git a/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp b/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp index d6ba637fe7..9cbdf390e4 100644 --- a/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp +++ b/tests/cpp-tests/Classes/AccelerometerTest/AccelerometerTest.cpp @@ -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) ); diff --git a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp index 5229f08e1e..12dce24a8a 100644 --- a/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp +++ b/tests/cpp-tests/Classes/ActionManagerTest/ActionManagerTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp index 69c2bf5332..a68ca11aef 100644 --- a/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp +++ b/tests/cpp-tests/Classes/ActionsProgressTest/ActionsProgressTest.cpp @@ -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 diff --git a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp index 7f5a5fd1be..ee7a3ecca7 100644 --- a/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp +++ b/tests/cpp-tests/Classes/ActionsTest/ActionsTest.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/BaseTest.cpp b/tests/cpp-tests/Classes/BaseTest.cpp index a69b3b12c1..08fbfe4733 100644 --- a/tests/cpp-tests/Classes/BaseTest.cpp +++ b/tests/cpp-tests/Classes/BaseTest.cpp @@ -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) ); } diff --git a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp index 799799aae8..7b615f539c 100644 --- a/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp +++ b/tests/cpp-tests/Classes/Box2DTest/Box2dTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp index 257d550aec..f4f9a1c878 100644 --- a/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp +++ b/tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp @@ -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) ); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp index 0354d9a268..e6bd2a83e1 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-1159.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp index a4e1a221b2..b108ec225d 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-458/QuestionContainerSprite.cpp @@ -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 diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp index 7fa35c81d1..237087b370 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-624.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp index 3dfb43c73d..25c712b854 100644 --- a/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp +++ b/tests/cpp-tests/Classes/BugsTest/Bug-914.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp index 6c40c408bc..6b480227a1 100644 --- a/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp +++ b/tests/cpp-tests/Classes/BugsTest/BugsTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp index 0b60c33b90..0f2a1e3b7b 100644 --- a/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp +++ b/tests/cpp-tests/Classes/ChipmunkTest/ChipmunkTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp index dd76d1c4e1..8ceea7225c 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -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 diff --git a/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp b/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp index 66ec4c4a02..e8171ad08b 100644 --- a/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp +++ b/tests/cpp-tests/Classes/CocosDenshionTest/CocosDenshionTest.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp b/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp index 8d92edf249..4e6573d649 100644 --- a/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp +++ b/tests/cpp-tests/Classes/CurlTest/CurlTest.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/CurlTest/CurlTest.h b/tests/cpp-tests/Classes/CurlTest/CurlTest.h index 131e3b330a..51875dd011 100644 --- a/tests/cpp-tests/Classes/CurlTest/CurlTest.h +++ b/tests/cpp-tests/Classes/CurlTest/CurlTest.h @@ -13,7 +13,7 @@ public: void onTouchesEnded(const std::vector& touches, cocos2d::Event *event); private: - cocos2d::LabelTTF* _label; + cocos2d::Label* _label; }; class CurlTestScene : public TestScene diff --git a/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp b/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp index a858a5c6e0..9f985d7a5c 100644 --- a/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp +++ b/tests/cpp-tests/Classes/CurrentLanguageTest/CurrentLanguageTest.cpp @@ -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(); diff --git a/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp b/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp index 35e612b15b..7299fa5941 100644 --- a/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp +++ b/tests/cpp-tests/Classes/DataVisitorTest/DataVisitorTest.cpp @@ -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); } diff --git a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp index da7f6a27b9..ed39dd9c57 100644 --- a/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp +++ b/tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 32f624d1ab..6be259f49d 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -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& 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()); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp index d9f9960045..6021f53404 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.cpp @@ -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) ); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.h index 37f17e1481..7576334a7d 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioComponentsTest/GameOverScene.h @@ -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 diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CocoStudioGUITest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CocoStudioGUITest.cpp index f534a5075b..5d88853afc 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CocoStudioGUITest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CocoStudioGUITest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp index 2447255365..64e67b3027 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CocosGUIScene.cpp @@ -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) { diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomGUIScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomGUIScene.cpp index 4c89986d0b..0e552843e0 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomGUIScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomGUIScene.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp index f44298c9e4..7e2067694c 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp index b40b72167c..bceed480e9 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp index 4bb87fa7dc..87321545bd 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomWidget/CustomImageView.cpp @@ -47,7 +47,7 @@ void CustomImageView::initRenderer() { ImageView::initRenderer(); - _label = LabelTTF::create(); + _label = Label::create(); CCNodeRGBA::addChild(_label, getLocalZOrder() + 1, -1); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomWidget/CustomImageView.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomWidget/CustomImageView.h index f45c583413..c80bb6958d 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomWidget/CustomImageView.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/CustomWidget/CustomImageView.h @@ -22,7 +22,7 @@ protected: virtual void initRenderer() override; protected: - cocos2d::LabelTTF* _label; + cocos2d::Label* _label; }; #endif /* defined(__TestCpp__CustomImageView__) */ diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/GUIEditorTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/GUIEditorTest.cpp index 1cc279395e..e3fad5940c 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/GUIEditorTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/GUIEditorTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp index bf98d36b3d..3a337ef3fa 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp index bdc0d86570..1cae9528cd 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp @@ -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, diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp index c636efd573..0b5f68f63a 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp index 345bbe0ebd..f67009ee0a 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp @@ -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, diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp index 6833df8b89..53572e9c07 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIImageViewTest/UIImageViewTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp index afc6ac6543..aa3b617afc 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILayoutTest/UILayoutTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp index 47e5bda78f..b62cc9224c 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIListViewTest/UIListViewTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp index 044052ee99..3f0b595e91 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UILoadingBarTest/UILoadingBarTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp index d510ba32c2..175eb55651 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp index f0f33e7afd..84b3af3f59 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIRichTextTest/UIRichTextTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp index 0ae7c15314..3edbc63428 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIScrollViewTest/UIScrollViewTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp index db7071f578..a87171c2c2 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp index 1c65ab219e..20dcf31e26 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp @@ -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, diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp index b752cdb56a..e1d2b3ee34 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextAtlasTest/UITextAtlasTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp index 8e14c9b270..ab203af60e 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp index d50b5afc9b..66f63ec4a5 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp index 71f0744825..76ed026964 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp @@ -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, diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextTest/UITextTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextTest/UITextTest.cpp index 3fe3cf6643..8e6d6af61a 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextTest/UITextTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UITextTest/UITextTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp index 456abac008..de5461160b 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioGUITest/UIWidgetAddNodeTest/UIWidgetAddNodeTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index e8f947004e..43430fc1a1 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -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) ); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp index 00cc48fa9e..e629274003 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h index 0a062a306d..930d98f658 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.h @@ -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) }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp index ffc05cad6c..6ab21b1a2a 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.cpp @@ -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()); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h index 39cc3d2095..8ae2e40912 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlColourPicker/CCControlColourPickerTest.h @@ -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) }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp index 0e7f79dc2e..50bcd87502 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.h b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.h index 219c9e1df1..88c77ed785 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControlPotentiometerTest.h @@ -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); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp index e5a009388a..5f42dc43d4 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h index f3f261c866..8a2f405e19 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlScene.h @@ -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); }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp index 15986bea2c..e905a3962e 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp @@ -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)); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h index bcbdc2eee8..ef60ea8885 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.h @@ -33,7 +33,7 @@ public: bool init(); void valueChanged(Ref *sender, Control::EventType controlEvent); protected: - LabelTTF* _displayValueLabel; + Label* _displayValueLabel; CONTROL_SCENE_CREATE_FUNC(ControlSliderTest) }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp index a954a73c36..29767e7349 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.h b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.h index 05a9f6d77e..bd03df7d6e 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.h @@ -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) }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp index b499c72bd7..ccc76afae8 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp @@ -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()); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h index 183298df43..79fa02cd98 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.h @@ -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) }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp index 0bf1506237..43cea9cf34 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h index 6e35298159..3cef026dbd 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h @@ -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; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp index 5e4c84f5a9..5fc2de984b 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp @@ -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) { diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp index 1a51cf5051..ac5310ca12 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h index 237ee35f92..ff97bbca26 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/HttpClientTest.h @@ -23,7 +23,7 @@ public: void onHttpRequestCompleted(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response); private: - cocos2d::LabelTTF* _labelStatusCode; + cocos2d::Label* _labelStatusCode; }; void runHttpClientTest(); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp index 1f10001da1..9e32839fc6 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp @@ -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); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h index f1e59073e3..2d25827d23 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/SocketIOTest.h @@ -43,7 +43,7 @@ public: cocos2d::network::SIOClient *_sioClient, *_sioEndpoint; - cocos2d::LabelTTF *_sioClientStatus; + cocos2d::Label *_sioClientStatus; }; void runSocketIOTest(); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp index b1eb337727..bb6f88302b 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp @@ -27,7 +27,7 @@ WebSocketTestLayer::WebSocketTestLayer() const int MARGIN = 40; const int SPACE = 35; - auto label = LabelTTF::create("WebSocket Test", "Arial", 28); + auto label = Label::create("WebSocket Test", "fonts/arial.ttf", 28); label->setPosition(Point(winSize.width / 2, winSize.height - MARGIN)); addChild(label, 0); @@ -36,32 +36,32 @@ WebSocketTestLayer::WebSocketTestLayer() addChild(menuRequest); // Send Text - auto labelSendText = LabelTTF::create("Send Text", "Arial", 22); + auto labelSendText = Label::create("Send Text", "fonts/arial.ttf", 22); auto itemSendText = MenuItemLabel::create(labelSendText, CC_CALLBACK_1(WebSocketTestLayer::onMenuSendTextClicked, this)); itemSendText->setPosition(Point(winSize.width / 2, winSize.height - MARGIN - SPACE)); menuRequest->addChild(itemSendText); // Send Binary - auto labelSendBinary = LabelTTF::create("Send Binary", "Arial", 22); + auto labelSendBinary = Label::create("Send Binary", "fonts/arial.ttf", 22); auto itemSendBinary = MenuItemLabel::create(labelSendBinary, CC_CALLBACK_1(WebSocketTestLayer::onMenuSendBinaryClicked, this)); itemSendBinary->setPosition(Point(winSize.width / 2, winSize.height - MARGIN - 2 * SPACE)); menuRequest->addChild(itemSendBinary); // Send Text Status Label - _sendTextStatus = LabelTTF::create("Send Text WS is waiting...", "Arial", 14, Size(160, 100), TextHAlignment::CENTER, TextVAlignment::TOP); + _sendTextStatus = Label::create("Send Text WS is waiting...", "fonts/arial.ttf", 14, Size(160, 100), TextHAlignment::CENTER, TextVAlignment::TOP); _sendTextStatus->setAnchorPoint(Point(0, 0)); _sendTextStatus->setPosition(Point(VisibleRect::left().x, VisibleRect::rightBottom().y + 25)); this->addChild(_sendTextStatus); // Send Binary Status Label - _sendBinaryStatus = LabelTTF::create("Send Binary WS is waiting...", "Arial", 14, Size(160, 100), TextHAlignment::CENTER, TextVAlignment::TOP); + _sendBinaryStatus = Label::create("Send Binary WS is waiting...", "fonts/arial.ttf", 14, Size(160, 100), TextHAlignment::CENTER, TextVAlignment::TOP); _sendBinaryStatus->setAnchorPoint(Point(0, 0)); _sendBinaryStatus->setPosition(Point(VisibleRect::left().x + 160, VisibleRect::rightBottom().y + 25)); this->addChild(_sendBinaryStatus); // Error Label - _errorStatus = LabelTTF::create("Error WS is waiting...", "Arial", 14, Size(160, 100), TextHAlignment::CENTER, TextVAlignment::TOP); + _errorStatus = Label::create("Error WS is waiting...", "fonts/arial.ttf", 14, Size(160, 100), TextHAlignment::CENTER, TextVAlignment::TOP); _errorStatus->setAnchorPoint(Point(0, 0)); _errorStatus->setPosition(Point(VisibleRect::left().x + 320, VisibleRect::rightBottom().y + 25)); this->addChild(_errorStatus); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h index 8b937ad1e6..c11beb2a45 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/NetworkTest/WebSocketTest.h @@ -37,9 +37,9 @@ private: cocos2d::network::WebSocket* _wsiSendBinary; cocos2d::network::WebSocket* _wsiError; - cocos2d::LabelTTF* _sendTextStatus; - cocos2d::LabelTTF* _sendBinaryStatus; - cocos2d::LabelTTF* _errorStatus; + cocos2d::Label* _sendTextStatus; + cocos2d::Label* _sendBinaryStatus; + cocos2d::Label* _errorStatus; int _sendTextTimes; int _sendBinaryTimes; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp index 94c94ce8a8..33b8ccbce8 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp @@ -88,8 +88,8 @@ NotificationCenterTest::NotificationCenterTest() pBackMenu->setPosition( Point::ZERO ); addChild(pBackMenu); - auto label1 = LabelTTF::create("switch off", "Marker Felt", 26); - auto label2 = LabelTTF::create("switch on", "Marker Felt", 26); + auto label1 = Label::create("switch off", "fonts/Marker Felt.ttf", 26); + auto label2 = Label::create("switch on", "fonts/Marker Felt.ttf", 26); auto item1 = MenuItemLabel::create(label1); auto item2 = MenuItemLabel::create(label2); auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(NotificationCenterTest::toggleSwitch, this), item1, item2, NULL); @@ -110,8 +110,8 @@ NotificationCenterTest::NotificationCenterTest() light->setPosition(Point(100, s.height/4*i)); addChild(light); - auto label1 = LabelTTF::create("not connected", "Marker Felt", 26); - auto label2 = LabelTTF::create("connected", "Marker Felt", 26); + auto label1 = Label::create("not connected", "fonts/Marker Felt.ttf", 26); + auto label2 = Label::create("connected", "fonts/Marker Felt.ttf", 26); auto item1 = MenuItemLabel::create(label1); auto item2 = MenuItemLabel::create(label2); auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(NotificationCenterTest::connectToSwitch, this), item1, item2, NULL); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp index 2b6e26b005..d703062c4c 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp @@ -80,7 +80,7 @@ TableViewCell* TableViewTestLayer::tableCellAtIndex(TableView *table, ssize_t id sprite->setPosition(Point(0, 0)); cell->addChild(sprite); - auto label = LabelTTF::create(string->getCString(), "Helvetica", 20.0); + auto label = Label::create(string->getCString(), "Helvetica", 20.0); label->setPosition(Point::ZERO); label->setAnchorPoint(Point::ZERO); label->setTag(123); @@ -88,7 +88,7 @@ TableViewCell* TableViewTestLayer::tableCellAtIndex(TableView *table, ssize_t id } else { - auto label = (LabelTTF*)cell->getChildByTag(123); + auto label = (Label*)cell->getChildByTag(123); label->setString(string->getCString()); } diff --git a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp index e76b44765a..ec83d4e4a2 100644 --- a/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp +++ b/tests/cpp-tests/Classes/FileUtilsTest/FileUtilsTest.cpp @@ -271,17 +271,17 @@ void TestIsFileExist::onEnter() auto s = Director::getInstance()->getWinSize(); auto sharedFileUtils = FileUtils::getInstance(); - LabelTTF* pTTF = NULL; + Label* pTTF = nullptr; bool isExist = false; isExist = sharedFileUtils->isFileExist("Images/grossini.png"); - pTTF = LabelTTF::create(isExist ? "Images/grossini.png exists" : "Images/grossini.png doesn't exist", "", 20); + pTTF = Label::create(isExist ? "Images/grossini.png exists" : "Images/grossini.png doesn't exist", "", 20); pTTF->setPosition(Point(s.width/2, s.height/3)); this->addChild(pTTF); isExist = sharedFileUtils->isFileExist("Images/grossini.xcf"); - pTTF = LabelTTF::create(isExist ? "Images/grossini.xcf exists" : "Images/grossini.xcf doesn't exist", "", 20); + pTTF = Label::create(isExist ? "Images/grossini.xcf exists" : "Images/grossini.xcf doesn't exist", "", 20); pTTF->setPosition(Point(s.width/2, s.height/3*2)); this->addChild(pTTF); } @@ -363,7 +363,7 @@ void TextWritePlist::onEnter() else log("write plist file failed"); - auto label = LabelTTF::create(fullPath.c_str(), "Thonburi", 6); + auto label = Label::create(fullPath.c_str(), "fonts/Thonburi.ttf", 6); this->addChild(label); auto winSize = Director::getInstance()->getWinSize(); label->setPosition(Point(winSize.width/2, winSize.height/3)); diff --git a/tests/cpp-tests/Classes/FontTest/FontTest.cpp b/tests/cpp-tests/Classes/FontTest/FontTest.cpp index e3a011d952..fa562cfc3a 100644 --- a/tests/cpp-tests/Classes/FontTest/FontTest.cpp +++ b/tests/cpp-tests/Classes/FontTest/FontTest.cpp @@ -97,12 +97,12 @@ void FontTest::showFont(const char *pFont) removeChildByTag(kTagColor2, true); removeChildByTag(kTagColor3, true); - auto top = LabelTTF::create(pFont, pFont, 24); - auto left = LabelTTF::create("alignment left", pFont, fontSize, + auto top = Label::create(pFont, pFont, 24); + auto left = Label::create("alignment left", pFont, fontSize, blockSize, TextHAlignment::LEFT, verticalAlignment[vAlignIdx]); - auto center = LabelTTF::create("alignment center", pFont, fontSize, + auto center = Label::create("alignment center", pFont, fontSize, blockSize, TextHAlignment::CENTER, verticalAlignment[vAlignIdx]); - auto right = LabelTTF::create("alignment right", pFont, fontSize, + auto right = Label::create("alignment right", pFont, fontSize, blockSize, TextHAlignment::RIGHT, verticalAlignment[vAlignIdx]); auto leftColor = LayerColor::create(Color4B(100, 100, 100, 255), blockSize.width, blockSize.height); diff --git a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp index 4084243f38..9e52c63fe9 100644 --- a/tests/cpp-tests/Classes/InputTest/MouseTest.cpp +++ b/tests/cpp-tests/Classes/InputTest/MouseTest.cpp @@ -3,17 +3,17 @@ MouseTest::MouseTest() { auto s = Director::getInstance()->getWinSize(); - auto title = LabelTTF::create("Mouse Test", "Arial", 28); + auto title = Label::create("Mouse Test", "fonts/arial.ttf", 28); addChild(title, 0); title->setPosition( Point(s.width/2, s.height-50) ); //Create a label to display the mouse action - _labelAction = LabelTTF::create("Click mouse button and see this change", "Arial", 22); + _labelAction = Label::create("Click mouse button and see this change", "fonts/arial.ttf", 22); _labelAction->setPosition(Point(s.width/2, s.height*2/3)); addChild(_labelAction, 0); //Create a label to display the mouse position - _labelPosition = LabelTTF::create("Mouse not supported on this device", "Arial", 22); + _labelPosition = Label::create("Mouse not supported on this device", "fonts/arial.ttf", 22); _labelPosition->setPosition(Point(s.width/2, s.height/3)); addChild(_labelPosition); diff --git a/tests/cpp-tests/Classes/InputTest/MouseTest.h b/tests/cpp-tests/Classes/InputTest/MouseTest.h index 8be1bd270d..a520bbca98 100644 --- a/tests/cpp-tests/Classes/InputTest/MouseTest.h +++ b/tests/cpp-tests/Classes/InputTest/MouseTest.h @@ -16,8 +16,8 @@ public: void onMouseScroll(Event* event); private: - LabelTTF* _labelAction; - LabelTTF* _labelPosition; + Label* _labelAction; + Label* _labelPosition; EventListenerMouse* _mouseListener; }; diff --git a/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.cpp b/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.cpp index 24b95f0df6..d930f49982 100644 --- a/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.cpp +++ b/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.cpp @@ -3,7 +3,7 @@ KeyboardTest::KeyboardTest() { auto s = Director::getInstance()->getWinSize(); - auto label = LabelTTF::create("Keyboard Test", "Arial", 28); + auto label = Label::create("Keyboard Test", "fonts/arial.ttf", 28); addChild(label, 0); label->setPosition( Point(s.width/2, s.height-50) ); @@ -14,7 +14,7 @@ KeyboardTest::KeyboardTest() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // create a label to display the tip string - _label = LabelTTF::create("Please press any key and see console log...", "Arial", 22); + _label = Label::create("Please press any key and see console log...", "fonts/arial.ttf", 22); _label->setPosition(Point(s.width / 2, s.height / 2)); addChild(_label, 0); diff --git a/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.h b/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.h index 6a8a65186e..6492df7107 100644 --- a/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.h +++ b/tests/cpp-tests/Classes/KeyboardTest/KeyboardTest.h @@ -14,7 +14,7 @@ public: void onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event); private: - LabelTTF* _label; + Label* _label; }; class KeyboardTestScene : public TestScene diff --git a/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp b/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp index b025680265..627eaa3b08 100644 --- a/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp +++ b/tests/cpp-tests/Classes/KeypadTest/KeypadTest.cpp @@ -3,7 +3,7 @@ KeypadTest::KeypadTest() { auto s = Director::getInstance()->getWinSize(); - auto label = LabelTTF::create("Keypad Test", "Arial", 28); + auto label = Label::create("Keypad Test", "fonts/arial.ttf", 28); addChild(label, 0); label->setPosition( Point(s.width/2, s.height-50) ); @@ -13,7 +13,7 @@ KeypadTest::KeypadTest() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); // create a label to display the tip string - _label = LabelTTF::create("Please press any key...", "Arial", 22); + _label = Label::create("Please press any key...", "fonts/arial.ttf", 22); _label->setPosition(Point(s.width / 2, s.height / 2)); addChild(_label, 0); diff --git a/tests/cpp-tests/Classes/KeypadTest/KeypadTest.h b/tests/cpp-tests/Classes/KeypadTest/KeypadTest.h index c327e1420c..02efc5150f 100644 --- a/tests/cpp-tests/Classes/KeypadTest/KeypadTest.h +++ b/tests/cpp-tests/Classes/KeypadTest/KeypadTest.h @@ -13,7 +13,7 @@ public: void onKeyReleased(EventKeyboard::KeyCode keycode, Event* event); private: - LabelTTF* _label; + Label* _label; }; class KeypadTestScene : public TestScene diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp index 14c3acba1d..1fb64b40ad 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp @@ -797,7 +797,7 @@ LabelsEmpty::LabelsEmpty() label1->setPosition(Point(s.width/2, s.height-100)); // LabelTTF - auto label2 = LabelTTF::create("", "Arial", 24); + auto label2 = LabelTTF::create("", "fonts/arial.ttf", 24); addChild(label2, 0, kTagBitmapAtlas2); label2->setPosition(Point(s.width/2, s.height/2)); @@ -993,7 +993,7 @@ void LabelTTFTest::updateAlignment() CC_SAFE_RELEASE(_plabel); - _plabel = LabelTTF::create(this->getCurrentAlignment(), "Marker Felt", 32, + _plabel = LabelTTF::create(this->getCurrentAlignment(), "fonts/Marker Felt.ttf", 32, blockSize, _horizAlign, _vertAlign); _plabel->retain(); @@ -1108,7 +1108,7 @@ std::string LabelTTFMultiline::subtitle() const LabelTTFChinese::LabelTTFChinese() { auto size = Director::getInstance()->getWinSize(); - auto label = LabelTTF::create("中国", "Marker Felt", 30); + auto label = LabelTTF::create("中国", "fonts/Marker Felt.ttf", 30); label->setPosition(Point(size.width / 2, size.height /2)); this->addChild(label); } @@ -1343,7 +1343,7 @@ LabelTTFA8Test::LabelTTFA8Test() addChild(layer, -10); // LabelBMFont - auto label1 = LabelTTF::create("Testing A8 Format", "Marker Felt", 48); + auto label1 = LabelTTF::create("Testing A8 Format", "fonts/Marker Felt.ttf", 48); addChild(label1); label1->setColor(Color3B::RED); label1->setPosition(Point(s.width/2, s.height/2)); @@ -1459,7 +1459,7 @@ TTFFontInit::TTFFontInit() auto font = LabelTTF::create(); - font->setFontName("Marker Felt"); + font->setFontName("fonts/Marker Felt.ttf"); font->setFontSize(48); font->setString("It is working!"); this->addChild(font); @@ -1493,7 +1493,7 @@ TTFFontShadowAndStroke::TTFFontShadowAndStroke() 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; @@ -1512,7 +1512,7 @@ TTFFontShadowAndStroke::TTFFontShadowAndStroke() // create the stroke only label 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; @@ -1532,7 +1532,7 @@ TTFFontShadowAndStroke::TTFFontShadowAndStroke() // create the label stroke and shadow 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; diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp index 0dc64bee63..45d2fe067f 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp @@ -1575,13 +1575,13 @@ LabelFontNameTest::LabelFontNameTest() addChild(label1); FontDefinition fontDef; - fontDef._fontName = "Marker Felt"; + fontDef._fontName = "fonts/Marker Felt.ttf"; fontDef._fontSize = 32; auto label2 = Label::createWithFontDefinition("Create with FontDefinition",fontDef); label2->setPosition( Point(size.width/2, size.height * 0.6) ); addChild(label2); - auto label3 = Label::create("Marker Felt","Marker Felt",32); + auto label3 = Label::create("fonts/Marker Felt.ttf","fonts/Marker Felt.ttf",32); label3->setPosition( Point(size.width/2, size.height * 0.5) ); addChild(label3); } diff --git a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp index 8087e7e9e1..566cf19e4c 100644 --- a/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp +++ b/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp @@ -588,8 +588,8 @@ LayerGradientTest::LayerGradientTest() listener->onTouchesMoved = CC_CALLBACK_2(LayerGradientTest::onTouchesMoved, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - auto label1 = LabelTTF::create("Compressed Interpolation: Enabled", "Marker Felt", 26); - auto label2 = LabelTTF::create("Compressed Interpolation: Disabled", "Marker Felt", 26); + auto label1 = Label::create("Compressed Interpolation: Enabled", "fonts/Marker Felt.ttf", 26); + auto label2 = Label::create("Compressed Interpolation: Disabled", "fonts/Marker Felt.ttf", 26); auto item1 = MenuItemLabel::create(label1); auto item2 = MenuItemLabel::create(label2); auto item = MenuItemToggle::createWithCallback( CC_CALLBACK_1(LayerGradientTest::toggleItem, this), item1, item2, NULL); @@ -637,9 +637,7 @@ std::string LayerGradientTest::subtitle() const //------------------------------------------------------------------ LayerGradientTest2::LayerGradientTest2() { - auto layer = new LayerGradient; - layer->initWithColor(Color4B(255,0,0,255), Color4B(255,255,0,255)); - layer->autorelease(); + auto layer = LayerGradient::create(Color4B(255,0,0,255), Color4B(255,255,0,255)); addChild(layer); } diff --git a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp index bb4053c07a..4662bb0a3d 100644 --- a/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp +++ b/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp @@ -81,7 +81,7 @@ MenuLayerMainMenu::MenuLayerMainMenu() }); item4->setFontSizeObj(20); - item4->setFontName("Marker Felt"); + item4->setFontName("fonts/Marker Felt.ttf"); // Label Item (LabelBMFont) auto label = LabelBMFont::create("configuration", "fonts/bitmapFontTest3.fnt"); @@ -91,7 +91,7 @@ MenuLayerMainMenu::MenuLayerMainMenu() item5->setScale( 0.8f ); // Events - MenuItemFont::setFontName("Marker Felt"); + MenuItemFont::setFontName("fonts/Marker Felt.ttf"); // Bugs Item auto item6 = MenuItemFont::create("Bugs", CC_CALLBACK_1(MenuLayerMainMenu::menuCallbackBugsTest, this)); @@ -320,7 +320,7 @@ void MenuLayer2::menuCallbackAlign(Ref* sender) //------------------------------------------------------------------ MenuLayer3::MenuLayer3() { - MenuItemFont::setFontName("Marker Felt"); + MenuItemFont::setFontName("fonts/Marker Felt.ttf"); MenuItemFont::setFontSize(28); auto label = LabelBMFont::create("Enable AtlasItem", "fonts/bitmapFontTest3.fnt"); @@ -385,7 +385,7 @@ MenuLayer4::MenuLayer4() MenuItemFont::setFontSize(18); auto title1 = MenuItemFont::create("Sound"); title1->setEnabled(false); - MenuItemFont::setFontName( "Marker Felt" ); + MenuItemFont::setFontName( "fonts/Marker Felt.ttf" ); MenuItemFont::setFontSize(34); auto item1 = MenuItemToggle::createWithCallback( CC_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create( "On" ), @@ -396,7 +396,7 @@ MenuLayer4::MenuLayer4() MenuItemFont::setFontSize(18); auto title2 = MenuItemFont::create( "Music" ); title2->setEnabled(false); - MenuItemFont::setFontName( "Marker Felt" ); + MenuItemFont::setFontName( "fonts/Marker Felt.ttf" ); MenuItemFont::setFontSize(34); auto item2 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create( "On" ), @@ -407,7 +407,7 @@ MenuLayer4::MenuLayer4() MenuItemFont::setFontSize(18); auto title3 = MenuItemFont::create( "Quality" ); title3->setEnabled( false ); - MenuItemFont::setFontName( "Marker Felt" ); + MenuItemFont::setFontName( "fonts/Marker Felt.ttf" ); MenuItemFont::setFontSize(34); auto item3 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create( "High" ), @@ -418,7 +418,7 @@ MenuLayer4::MenuLayer4() MenuItemFont::setFontSize(18); auto title4 = MenuItemFont::create( "Orientation" ); title4->setEnabled(false); - MenuItemFont::setFontName( "Marker Felt" ); + MenuItemFont::setFontName( "fonts/Marker Felt.ttf" ); MenuItemFont::setFontSize(34); auto item4 = MenuItemToggle::createWithCallback(CC_CALLBACK_1(MenuLayer4::menuCallback, this), MenuItemFont::create( "Off" ), @@ -432,7 +432,7 @@ MenuLayer4::MenuLayer4() // you can change the one of the items by doing this item4->setSelectedIndex( 2 ); - MenuItemFont::setFontName( "Marker Felt" ); + MenuItemFont::setFontName( "fonts/Marker Felt.ttf" ); MenuItemFont::setFontSize( 34 ); auto label = LabelBMFont::create( "go back", "fonts/bitmapFontTest3.fnt" ); @@ -509,7 +509,7 @@ RemoveMenuItemWhenMove::RemoveMenuItemWhenMove() { auto s = Director::getInstance()->getWinSize(); - auto label = LabelTTF::create("click item and move, should not crash", "Arial", 20); + auto label = Label::create("click item and move, should not crash", "fonts/arial.ttf", 20); label->setPosition(Point(s.width/2, s.height - 30)); addChild(label); diff --git a/tests/cpp-tests/Classes/MutiTouchTest/MutiTouchTest.cpp b/tests/cpp-tests/Classes/MutiTouchTest/MutiTouchTest.cpp index a17e5a072f..7ef9fa89ab 100644 --- a/tests/cpp-tests/Classes/MutiTouchTest/MutiTouchTest.cpp +++ b/tests/cpp-tests/Classes/MutiTouchTest/MutiTouchTest.cpp @@ -62,7 +62,7 @@ bool MutiTouchTestLayer::init() listener->onTouchesEnded = CC_CALLBACK_2(MutiTouchTestLayer::onTouchesEnded, this); _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); - auto title = LabelTTF::create("Please touch the screen!", "", 24); + auto title = Label::create("Please touch the screen!", "", 24); title->setPosition(VisibleRect::top()+Point(0, -40)); addChild(title); diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 9852b62323..4e6cea901d 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -379,7 +379,7 @@ void RemoveListenerWhenDispatching::onEnter() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener1, sprite1); - auto statusLabel = LabelTTF::create("The sprite could be touched!", "", 20); + auto statusLabel = Label::create("The sprite could be touched!", "", 20); statusLabel->setPosition(origin + Point(size.width/2, size.height-90)); addChild(statusLabel); std::shared_ptr enable(new bool(true)); @@ -428,7 +428,7 @@ void CustomEventTest::onEnter() MenuItemFont::setFontSize(20); - auto statusLabel = LabelTTF::create("No custom event 1 received!", "", 20); + auto statusLabel = Label::create("No custom event 1 received!", "", 20); statusLabel->setPosition(origin + Point(size.width/2, size.height-90)); addChild(statusLabel); @@ -454,7 +454,7 @@ void CustomEventTest::onEnter() }); sendItem->setPosition(origin + Point(size.width/2, size.height/2)); - auto statusLabel2 = LabelTTF::create("No custom event 2 received!", "", 20); + auto statusLabel2 = Label::create("No custom event 2 received!", "", 20); statusLabel2->setPosition(origin + Point(size.width/2, size.height-120)); addChild(statusLabel2); @@ -511,7 +511,7 @@ void LabelKeyboardEventTest::onEnter() Point origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); - auto statusLabel = LabelTTF::create("No keyboard event received!", "", 20); + auto statusLabel = Label::create("No keyboard event received!", "", 20); statusLabel->setPosition(origin + Point(size.width/2, size.height/2)); addChild(statusLabel); @@ -519,14 +519,14 @@ void LabelKeyboardEventTest::onEnter() listener->onKeyPressed = [](EventKeyboard::KeyCode keyCode, Event* event){ char buf[100] = {0}; sprintf(buf, "Key %d was pressed!", (int)keyCode); - auto label = static_cast(event->getCurrentTarget()); + auto label = static_cast(event->getCurrentTarget()); label->setString(buf); }; listener->onKeyReleased = [](EventKeyboard::KeyCode keyCode, Event* event){ char buf[100] = {0}; sprintf(buf, "Key %d was released!", (int)keyCode); - auto label = static_cast(event->getCurrentTarget()); + auto label = static_cast(event->getCurrentTarget()); label->setString(buf); }; @@ -783,19 +783,23 @@ void DirectorEventTest::onEnter() TTFConfig ttfConfig("fonts/arial.ttf", 20); _label1 = Label::createWithTTF(ttfConfig, "Update: 0"); + _label1->setAnchorPoint(Point::ANCHOR_BOTTOM_LEFT); _label1->setPosition(30,s.height/2 + 60); this->addChild(_label1); _label2 = Label::createWithTTF(ttfConfig, "Visit: 0"); + _label2->setAnchorPoint(Point::ANCHOR_BOTTOM_LEFT); _label2->setPosition(30,s.height/2 + 20); this->addChild(_label2); _label3 = Label::createWithTTF(ttfConfig, "Draw: 0"); + _label3->setAnchorPoint(Point::ANCHOR_BOTTOM_LEFT); _label3->setPosition(30,30); _label3->setPosition(30,s.height/2 - 20); this->addChild(_label3); _label4 = Label::createWithTTF(ttfConfig, "Projection: 0"); + _label4->setAnchorPoint(Point::ANCHOR_BOTTOM_LEFT); _label4->setPosition(30,30); _label4->setPosition(30,s.height/2 - 60); this->addChild(_label4); @@ -1176,7 +1180,7 @@ Issue4129::Issue4129() { _customlistener = _eventDispatcher->addCustomEventListener(EVENT_COME_TO_BACKGROUND, [this](EventCustom* event){ - auto label = LabelTTF::create("Yeah, this issue was fixed.", "", 20); + auto label = Label::create("Yeah, this issue was fixed.", "", 20); label->setAnchorPoint(Point(0, 0.5f)); label->setPosition(Point(VisibleRect::left())); this->addChild(label); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp index e77122a13e..ad0e8d754a 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceAllocTest.cpp @@ -94,7 +94,7 @@ void PerformceAllocScene::initWithQuantityOfNodes(unsigned int nNodes) auto s = Director::getInstance()->getWinSize(); // Title - auto label = LabelTTF::create(title().c_str(), "Arial", 32); + auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2, s.height-50)); @@ -102,7 +102,7 @@ void PerformceAllocScene::initWithQuantityOfNodes(unsigned int nNodes) std::string strSubTitle = subtitle(); if(strSubTitle.length()) { - auto l = LabelTTF::create(strSubTitle.c_str(), "Thonburi", 16); + auto l = Label::create(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1); l->setPosition(Point(s.width/2, s.height-80)); } @@ -142,7 +142,7 @@ void PerformceAllocScene::initWithQuantityOfNodes(unsigned int nNodes) menu->setPosition(Point(s.width/2, s.height/2+15)); addChild(menu, 1); - auto infoLabel = LabelTTF::create("0 nodes", "Marker Felt", 30); + auto infoLabel = Label::create("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(Point(s.width/2, s.height/2-15)); addChild(infoLabel, 1, kTagInfoLayer); @@ -171,7 +171,7 @@ void PerformceAllocScene::updateQuantityLabel() { if( quantityOfNodes != lastRenderedCount ) { - auto infoLabel = static_cast( getChildByTag(kTagInfoLayer) ); + auto infoLabel = static_cast( getChildByTag(kTagInfoLayer) ); char str[20] = {0}; sprintf(str, "%u nodes", quantityOfNodes); infoLabel->setString(str); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp index b502ebdc90..64df9e671f 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceContainerTest.cpp @@ -96,7 +96,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) auto s = Director::getInstance()->getWinSize(); // Title - auto label = LabelTTF::create(title().c_str(), "Arial", 32); + auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1, TAG_TITLE); label->setPosition(Point(s.width/2, s.height-50)); @@ -104,7 +104,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) std::string strSubTitle = subtitle(); if(strSubTitle.length()) { - auto l = LabelTTF::create(strSubTitle.c_str(), "Thonburi", 16); + auto l = Label::create(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1, TAG_SUBTITLE); l->setPosition(Point(s.width/2, s.height-80)); } @@ -147,7 +147,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) menu->setPosition(Point(s.width/2, s.height/2+15)); addChild(menu, 1); - auto infoLabel = LabelTTF::create("0 nodes", "Marker Felt", 30); + auto infoLabel = Label::create("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(Point(s.width/2, s.height/2-15)); addChild(infoLabel, 1, kTagInfoLayer); @@ -176,7 +176,7 @@ void PerformanceContainerScene::initWithQuantityOfNodes(unsigned int nNodes) auto toggle = MenuItemToggle::createWithCallback([this](Ref* sender){ auto toggle = static_cast(sender); this->_type = toggle->getSelectedIndex(); - auto label = static_cast(this->getChildByTag(TAG_SUBTITLE)); + auto label = static_cast(this->getChildByTag(TAG_SUBTITLE)); label->setString(StringUtils::format("Test '%s', See console", this->_testFunctions[this->_type].name)); this->updateProfilerName(); }, toggleItems); @@ -248,7 +248,7 @@ void PerformanceContainerScene::updateQuantityLabel() { if( quantityOfNodes != lastRenderedCount ) { - auto infoLabel = static_cast( getChildByTag(kTagInfoLayer) ); + auto infoLabel = static_cast( getChildByTag(kTagInfoLayer) ); char str[20] = {0}; sprintf(str, "%u nodes", quantityOfNodes); infoLabel->setString(str); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp index b7d1ac45e5..e49e02bb19 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceEventDispatcherTest.cpp @@ -94,7 +94,7 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode auto s = Director::getInstance()->getWinSize(); // Title - auto label = LabelTTF::create(title().c_str(), "Arial", 32); + auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1, TAG_TITLE); label->setPosition(Point(s.width/2, s.height-50)); @@ -102,7 +102,7 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode std::string strSubTitle = subtitle(); if(strSubTitle.length()) { - auto l = LabelTTF::create(strSubTitle.c_str(), "Thonburi", 16); + auto l = Label::create(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1, TAG_SUBTITLE); l->setPosition(Point(s.width/2, s.height-80)); } @@ -145,7 +145,7 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode menu->setPosition(Point(s.width/2, s.height/2+15)); addChild(menu, 1); - auto infoLabel = LabelTTF::create("0 listeners", "Marker Felt", 30); + auto infoLabel = Label::create("0 listeners", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(Point(s.width/2, s.height/2-15)); addChild(infoLabel, 1, kTagInfoLayer); @@ -192,7 +192,7 @@ void PerformanceEventDispatcherScene::initWithQuantityOfNodes(unsigned int nNode auto toggle = MenuItemToggle::createWithCallback([=](Ref* sender){ auto toggle = static_cast(sender); this->_type = toggle->getSelectedIndex(); - auto label = static_cast(this->getChildByTag(TAG_SUBTITLE)); + auto label = static_cast(this->getChildByTag(TAG_SUBTITLE)); label->setString(StringUtils::format("Test '%s', See console", this->_testFunctions[this->_type].name)); this->updateProfilerName(); reset(); @@ -267,7 +267,7 @@ void PerformanceEventDispatcherScene::updateQuantityLabel() { if( _quantityOfNodes != _lastRenderedCount ) { - auto infoLabel = static_cast( getChildByTag(kTagInfoLayer) ); + auto infoLabel = static_cast( getChildByTag(kTagInfoLayer) ); char str[20] = {0}; sprintf(str, "%u listeners", _quantityOfNodes); infoLabel->setString(str); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp index 2f91a04792..14c52e49c3 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.cpp @@ -102,7 +102,7 @@ void LabelMainScene::initWithSubTest(int nodes) menu->setPosition(Point(s.width/2, s.height-65)); addChild(menu, 1); - auto infoLabel = LabelTTF::create("0 nodes", "Marker Felt", 30); + auto infoLabel = Label::create("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(Point(s.width/2, s.height-90)); addChild(infoLabel, 1, kTagInfoLayer); @@ -118,7 +118,7 @@ void LabelMainScene::initWithSubTest(int nodes) auto menuAutoTest = Menu::create(); menuAutoTest->setPosition( Point::ZERO ); - MenuItemFont::setFontName("Arial"); + MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); MenuItemFont* autoTestItem = NULL; @@ -136,7 +136,7 @@ void LabelMainScene::initWithSubTest(int nodes) menuAutoTest->addChild(autoTestItem); addChild( menuAutoTest, 3, kTagAutoTestMenu ); - _title = LabelTTF::create(title().c_str(), "Arial", 32); + _title = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(_title, 1); _title->setPosition(Point(s.width/2, s.height-50)); @@ -173,7 +173,7 @@ void LabelMainScene::updateNodes() { if( _quantityNodes != _lastRenderedCount ) { - auto infoLabel = (LabelTTF *) getChildByTag(kTagInfoLayer); + auto infoLabel = (Label *) getChildByTag(kTagInfoLayer); char str[16] = {0}; sprintf(str, "%u nodes", _quantityNodes); infoLabel->setString(str); @@ -194,7 +194,7 @@ void LabelMainScene::onIncrease(Ref* sender) case kCaseLabelTTFUpdate: for( int i=0;i< kNodesIncrease;i++) { - auto label = LabelTTF::create("LabelTTF", "Marker Felt", 30); + auto label = Label::create("LabelTTF", "Marker Felt", 30); label->setPosition(Point((size.width/2 + rand() % 50), ((int)size.height/2 + rand() % 50))); _labelContainer->addChild(label, 1, _quantityNodes); @@ -323,7 +323,7 @@ void LabelMainScene::updateText(float dt) { case kCaseLabelTTFUpdate: for(const auto &child : children) { - LabelTTF* label = (LabelTTF*)child; + Label* label = (Label*)child; label->setString(text); } break; diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.h b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.h index 6deca05e39..f86b60800b 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.h +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceLabelTest.h @@ -58,7 +58,7 @@ private: void finishAutoTest(); Layer* _labelContainer; - LabelTTF* _title; + Label* _title; int _lastRenderedCount; int _quantityNodes; diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp index cf0fd19843..05b520349b 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceNodeChildrenTest.cpp @@ -123,7 +123,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) auto s = Director::getInstance()->getWinSize(); // Title - auto label = LabelTTF::create(title().c_str(), "Arial", 32); + auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2, s.height-50)); @@ -131,7 +131,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) std::string strSubTitle = subtitle(); if(strSubTitle.length()) { - auto l = LabelTTF::create(strSubTitle.c_str(), "Thonburi", 16); + auto l = Label::create(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1); l->setPosition(Point(s.width/2, s.height-80)); } @@ -171,7 +171,7 @@ void NodeChildrenMainScene::initWithQuantityOfNodes(unsigned int nNodes) menu->setPosition(Point(s.width/2, s.height/2+15)); addChild(menu, 1); - auto infoLabel = LabelTTF::create("0 nodes", "Marker Felt", 30); + auto infoLabel = Label::create("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(Point(s.width/2, s.height/2-15)); addChild(infoLabel, 1, kTagInfoLayer); @@ -200,7 +200,7 @@ void NodeChildrenMainScene::updateQuantityLabel() { if( quantityOfNodes != lastRenderedCount ) { - auto infoLabel = static_cast( getChildByTag(kTagInfoLayer) ); + auto infoLabel = static_cast( getChildByTag(kTagInfoLayer) ); char str[20] = {0}; sprintf(str, "%u nodes", quantityOfNodes); infoLabel->setString(str); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp index 468fe4afe8..8b53cb93ae 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceParticleTest.cpp @@ -103,7 +103,7 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) menu->setPosition(Point(s.width/2, s.height/2+15)); addChild(menu, 1); - auto infoLabel = LabelTTF::create("0 nodes", "Marker Felt", 30); + auto infoLabel = Label::create("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(Point(s.width/2, s.height - 90)); addChild(infoLabel, 1, kTagInfoLayer); @@ -142,7 +142,7 @@ void ParticleMainScene::initWithSubTest(int asubtest, int particles) pSubMenu->setPosition(Point(s.width/2, 80)); addChild(pSubMenu, 2); - auto label = LabelTTF::create(title().c_str(), "Arial", 32); + auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2, s.height-50)); @@ -258,7 +258,7 @@ void ParticleMainScene::updateQuantityLabel() { if( quantityParticles != lastRenderedCount ) { - auto infoLabel = (LabelTTF *) getChildByTag(kTagInfoLayer); + auto infoLabel = (Label *) getChildByTag(kTagInfoLayer); char str[20] = {0}; sprintf(str, "%u particles", quantityParticles); infoLabel->setString(str); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp index 42c0279bff..bfeec52d6f 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.cpp @@ -38,7 +38,7 @@ void ScenarioMenuLayer::onEnter() auto s = Director::getInstance()->getWinSize(); // Title - auto label = LabelTTF::create(title().c_str(), "Arial", 32); + auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2, s.height-50)); @@ -46,7 +46,7 @@ void ScenarioMenuLayer::onEnter() std::string strSubTitle = subtitle(); if(strSubTitle.length()) { - auto l = LabelTTF::create(strSubTitle.c_str(), "Thonburi", 16); + auto l = Label::create(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1); l->setPosition(Point(s.width/2, s.height-80)); } @@ -154,19 +154,19 @@ void ScenarioTest::performTests() // add tip labels - _spriteLabel = LabelTTF::create("Sprites : 0", "Arial", 15); + _spriteLabel = Label::create("Sprites : 0", "fonts/arial.ttf", 15); _spriteLabel->setAnchorPoint(Point(0.0f, 0.5f)); addChild(_spriteLabel, 10); _spriteLabel->setPosition(Point(origin.x, origin.y + s.height/2 + 70)); char str[32] = { 0 }; sprintf(str, "Particles : %d", _particleNumber); - _particleLabel = LabelTTF::create(str, "Arial", 15); + _particleLabel = Label::create(str, "fonts/arial.ttf", 15); _particleLabel->setAnchorPoint(Point(0.0f, 0.5f)); addChild(_particleLabel, 10); _particleLabel->setPosition(Point(origin.x, origin.y + s.height/2 + 45)); - _parsysLabel = LabelTTF::create("Particle System : 0", "Arial", 15); + _parsysLabel = Label::create("Particle System : 0", "fonts/arial.ttf", 15); _parsysLabel->setAnchorPoint(Point(0.0f, 0.5f)); addChild(_parsysLabel, 10); _parsysLabel->setPosition(Point(origin.x, origin.y + s.height/2 + 20)); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.h b/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.h index b5c34aa6e6..7ccccb8ec7 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.h +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceScenarioTest.h @@ -58,9 +58,9 @@ private: MenuItemToggle* _itemToggle; Vector _spriteArray; Vector _parsysArray; - LabelTTF* _spriteLabel; - LabelTTF* _particleLabel; - LabelTTF* _parsysLabel; + Label* _spriteLabel; + Label* _particleLabel; + Label* _parsysLabel; int _particleNumber; }; diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp index 45c2f819d5..98cc8550ec 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceSpriteTest.cpp @@ -391,7 +391,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) menu->setPosition(Point(s.width/2, s.height-65)); addChild(menu, 1); - auto infoLabel = LabelTTF::create("0 nodes", "Marker Felt", 30); + auto infoLabel = Label::create("0 nodes", "fonts/Marker Felt.ttf", 30); infoLabel->setColor(Color3B(0,200,20)); infoLabel->setPosition(Point(s.width/2, s.height-90)); addChild(infoLabel, 1, kTagInfoLayer); @@ -407,7 +407,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) auto menuAutoTest = Menu::create(); menuAutoTest->setPosition( Point::ZERO ); - MenuItemFont::setFontName("Arial"); + MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); MenuItemFont* autoTestItem = NULL; @@ -450,7 +450,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) addChild(subMenu, 2); // add title label - auto label = LabelTTF::create(title(), "Arial", 32); + auto label = Label::create(title(), "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2, s.height-50)); @@ -459,7 +459,7 @@ void SpriteMainScene::initWithSubTest(int asubtest, int nNodes) std::string strSubtitle = subtitle(); if( ! strSubtitle.empty() ) { - auto l = LabelTTF::create(strSubtitle.c_str(), "Thonburi", 16); + auto l = Label::create(strSubtitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 9999); l->setPosition( Point(VisibleRect::center().x, VisibleRect::top().y - 60) ); } @@ -505,7 +505,7 @@ void SpriteMainScene::updateNodes() { if( quantityNodes != lastRenderedCount ) { - auto infoLabel = (LabelTTF *) getChildByTag(kTagInfoLayer); + auto infoLabel = (Label *) getChildByTag(kTagInfoLayer); char str[16] = {0}; sprintf(str, "%u nodes", quantityNodes); infoLabel->setString(str); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp index 9142085c74..ea522818f9 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTest.cpp @@ -53,7 +53,7 @@ void PerformanceMainLayer::onEnter() _itemMenu = Menu::create(); _itemMenu->setPosition(_CurrentPos); - MenuItemFont::setFontName("Arial"); + MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); for (int i = 0; i < g_testMax; ++i) { @@ -149,7 +149,7 @@ void PerformBasicLayer::onEnter() { Layer::onEnter(); - MenuItemFont::setFontName("Arial"); + MenuItemFont::setFontName("fonts/arial.ttf"); MenuItemFont::setFontSize(24); auto pMainItem = MenuItemFont::create("Back", CC_CALLBACK_1(PerformBasicLayer::toMainLayer, this)); pMainItem->setPosition(Point(VisibleRect::rightBottom().x - 50, VisibleRect::rightBottom().y + 25)); diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp index 668eeb1828..311eeb1491 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTextureTest.cpp @@ -48,7 +48,7 @@ void TextureMenuLayer::onEnter() auto s = Director::getInstance()->getWinSize(); // Title - auto label = LabelTTF::create(title().c_str(), "Arial", 32); + auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2, s.height-50)); @@ -56,7 +56,7 @@ void TextureMenuLayer::onEnter() std::string strSubTitle = subtitle(); if(strSubTitle.length()) { - auto l = LabelTTF::create(strSubTitle.c_str(), "Thonburi", 16); + auto l = Label::create(strSubTitle.c_str(), "fonts/Thonburi.ttf", 16); addChild(l, 1); l->setPosition(Point(s.width/2, s.height-80)); } diff --git a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp index fa570de98a..1e628ba9f7 100644 --- a/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp +++ b/tests/cpp-tests/Classes/PerformanceTest/PerformanceTouchesTest.cpp @@ -73,7 +73,7 @@ void TouchesMainScene::onEnter() auto s = Director::getInstance()->getWinSize(); // add title - auto label = LabelTTF::create(title().c_str(), "Arial", 32); + auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2, s.height-50)); @@ -223,7 +223,7 @@ void TouchesPerformTest3::onEnter() auto s = Director::getInstance()->getWinSize(); // add title - auto label = LabelTTF::create(title().c_str(), "Arial", 32); + auto label = Label::create(title().c_str(), "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2, s.height-50)); @@ -248,7 +248,7 @@ void TouchesPerformTest3::onEnter() layer->release(); } - auto emitEventlabel = LabelTTF::create("Emit Touch Event", "", 24); + auto emitEventlabel = Label::create("Emit Touch Event", "", 24); auto menuItem = MenuItemLabel::create(emitEventlabel, [this](Ref* sender){ CC_PROFILER_PURGE_ALL(); diff --git a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp index f793e7b8f7..9f5bcf1f8f 100644 --- a/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp +++ b/tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp @@ -86,8 +86,8 @@ void PhysicsTestScene::toggleDebug() #if CC_USE_PHYSICS == 0 void PhysicsDemoDisabled::onEnter() { - auto label = LabelTTF::create("Should define CC_USE_PHYSICS\n to run this test case", - "Arial", + auto label = Label::create("Should define CC_USE_PHYSICS\n to run this test case", + "fonts/arial.ttf", 18); auto size = Director::getInstance()->getWinSize(); label->setPosition(Point(size.width/2, size.height/2)); @@ -1310,7 +1310,7 @@ void PhysicsContactTest::onEnter() menu1->setPosition(Point(s.width/2, s.height-50)); addChild(menu1, 1); - auto label = LabelTTF::create("yellow box", "Arial", 32); + auto label = Label::create("yellow box", "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2 - 150, s.height-50)); @@ -1326,7 +1326,7 @@ void PhysicsContactTest::onEnter() menu2->setPosition(Point(s.width/2, s.height-90)); addChild(menu2, 1); - label = LabelTTF::create("blue box", "Arial", 32); + label = Label::create("blue box", "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2 - 150, s.height-90)); @@ -1342,7 +1342,7 @@ void PhysicsContactTest::onEnter() menu3->setPosition(Point(s.width/2, s.height-130)); addChild(menu3, 1); - label = LabelTTF::create("yellow triangle", "Arial", 32); + label = Label::create("yellow triangle", "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2 - 150, s.height-130)); @@ -1358,7 +1358,7 @@ void PhysicsContactTest::onEnter() menu4->setPosition(Point(s.width/2, s.height-170)); addChild(menu4, 1); - label = LabelTTF::create("blue triangle", "Arial", 32); + label = Label::create("blue triangle", "fonts/arial.ttf", 32); addChild(label, 1); label->setPosition(Point(s.width/2 - 150, s.height-170)); @@ -1425,22 +1425,22 @@ void PhysicsContactTest::resetTest() char buffer[10]; sprintf(buffer, "%d", _yellowBoxNum); - auto label = LabelTTF::create(buffer, "Arial", 32); + auto label = Label::create(buffer, "fonts/arial.ttf", 32); root->addChild(label, 1); label->setPosition(Point(s.width/2, s.height-50)); sprintf(buffer, "%d", _blueBoxNum); - label = LabelTTF::create(buffer, "Arial", 32); + label = Label::create(buffer, "fonts/arial.ttf", 32); root->addChild(label, 1); label->setPosition(Point(s.width/2, s.height-90)); sprintf(buffer, "%d", _yellowTriangleNum); - label = LabelTTF::create(buffer, "Arial", 32); + label = Label::create(buffer, "fonts/arial.ttf", 32); root->addChild(label, 1); label->setPosition(Point(s.width/2, s.height-130)); sprintf(buffer, "%d", _blueTriangleNum); - label = LabelTTF::create(buffer, "Arial", 32); + label = Label::create(buffer, "fonts/arial.ttf", 32); root->addChild(label, 1); label->setPosition(Point(s.width/2, s.height-170)); diff --git a/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp b/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp index 47b229029a..80fc376d80 100644 --- a/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp +++ b/tests/cpp-tests/Classes/ReleasePoolTest/ReleasePoolTest.cpp @@ -25,7 +25,7 @@ private: void ReleasePoolTestScene::runThisTest() { // title - auto label = LabelTTF::create("AutoreasePool Test", "Arial", 32); + auto label = Label::create("AutoreasePool Test", "fonts/arial.ttf", 32); addChild(label, 9999); label->setPosition(Point(VisibleRect::center().x, VisibleRect::top().y - 30)); diff --git a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp index 49e5848a08..f24c26fa4c 100644 --- a/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp +++ b/tests/cpp-tests/Classes/RenderTextureTest/RenderTextureTest.cpp @@ -302,15 +302,15 @@ RenderTextureZbuffer::RenderTextureZbuffer() _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this); auto size = Director::getInstance()->getWinSize(); - auto label = LabelTTF::create("vertexZ = 50", "Marker Felt", 64); + auto label = Label::create("vertexZ = 50", "fonts/Marker Felt.ttf", 64); label->setPosition(Point(size.width / 2, size.height * 0.25f)); this->addChild(label); - auto label2 = LabelTTF::create("vertexZ = 0", "Marker Felt", 64); + auto label2 = Label::create("vertexZ = 0", "fonts/Marker Felt.ttf", 64); label2->setPosition(Point(size.width / 2, size.height * 0.5f)); this->addChild(label2); - auto label3 = LabelTTF::create("vertexZ = -50", "Marker Felt", 64); + auto label3 = Label::create("vertexZ = -50", "fonts/Marker Felt.ttf", 64); label3->setPosition(Point(size.width / 2, size.height * 0.75f)); this->addChild(label3); diff --git a/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp b/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp index 865861a5ab..b89d857f71 100644 --- a/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp +++ b/tests/cpp-tests/Classes/RotateWorldTest/RotateWorldTest.cpp @@ -19,7 +19,7 @@ void TestLayer::onEnter() //auto array = [UIFont familyNames]; //for( String *s in array ) // NSLog( s ); - auto label = LabelTTF::create("cocos2d", "Tahoma", 64); + auto label = Label::create("cocos2d", "Tahoma", 64); label->setPosition( Point(x/2,y/2) ); diff --git a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp index 084ff76490..3d73f7816a 100644 --- a/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp +++ b/tests/cpp-tests/Classes/TextInputTest/TextInputTest.cpp @@ -13,7 +13,7 @@ enum kTextInputTestsCount, }; -#define FONT_NAME "Thonburi" +#define FONT_NAME "fonts/Thonburi.ttf" #define FONT_SIZE 36 static int testIdx = -1; @@ -371,7 +371,7 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * sender, const } // create a insert text sprite and do some action - auto label = LabelTTF::create(text, FONT_NAME, FONT_SIZE); + auto label = Label::create(text, FONT_NAME, FONT_SIZE); this->addChild(label); Color3B color(226, 121, 7); label->setColor(color); @@ -404,7 +404,7 @@ bool TextFieldTTFActionTest::onTextFieldInsertText(TextFieldTTF * sender, const bool TextFieldTTFActionTest::onTextFieldDeleteBackward(TextFieldTTF * sender, const char * delText, size_t nLen) { // create a delete text sprite and do some action - auto label = LabelTTF::create(delText, FONT_NAME, FONT_SIZE); + auto label = Label::create(delText, FONT_NAME, FONT_SIZE); this->addChild(label); // move the sprite to fly out diff --git a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp index ceaa76a937..16d1f1db44 100644 --- a/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp +++ b/tests/cpp-tests/Classes/Texture2dTest/Texture2dTest.cpp @@ -1520,7 +1520,7 @@ void TextureAsync::onEnter() auto size = Director::getInstance()->getWinSize(); - auto label = LabelTTF::create("Loading...", "Marker Felt", 32); + auto label = Label::create("Loading...", "fonts/Marker Felt.ttf", 32); label->setPosition(Point( size.width/2, size.height/2)); addChild(label, 10); diff --git a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp index 5df463d27d..59b9aa4a6e 100644 --- a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp +++ b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.cpp @@ -12,8 +12,8 @@ TextureCacheTest::TextureCacheTest() { auto size = Director::getInstance()->getWinSize(); - _labelLoading = LabelTTF::create("loading...", "Arial", 15); - _labelPercent = LabelTTF::create("%0", "Arial", 15); + _labelLoading = Label::create("loading...", "fonts/arial.ttf", 15); + _labelPercent = Label::create("%0", "fonts/arial.ttf", 15); _labelLoading->setPosition(Point(size.width / 2, size.height / 2 - 20)); _labelPercent->setPosition(Point(size.width / 2, size.height / 2 + 20)); diff --git a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.h b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.h index b2dfdf7d2e..b273c31943 100644 --- a/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.h +++ b/tests/cpp-tests/Classes/TextureCacheTest/TextureCacheTest.h @@ -13,8 +13,8 @@ public: void loadingCallBack(cocos2d::Texture2D *texture); private: - cocos2d::LabelTTF *_labelLoading; - cocos2d::LabelTTF *_labelPercent; + cocos2d::Label *_labelLoading; + cocos2d::Label *_labelPercent; int _numberOfSprites; int _numberOfLoadedSprites; }; diff --git a/tests/cpp-tests/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp b/tests/cpp-tests/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp index f647e99d9b..0e7f9fbd67 100644 --- a/tests/cpp-tests/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp +++ b/tests/cpp-tests/Classes/TexturePackerEncryptionTest/TextureAtlasEncryptionTest.cpp @@ -18,14 +18,14 @@ void TextureAtlasEncryptionDemo::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 * 0.75f) ); 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-80) ); this->addChild(subLabel, 1); } @@ -38,7 +38,7 @@ void TextureAtlasEncryptionDemo::onEnter() nonencryptedSprite->setPosition(Point(s.width * 0.25f, s.height * 0.5f)); this->addChild(nonencryptedSprite); - auto nonencryptedSpriteLabel = LabelTTF::create("non-encrypted", "Arial", 28); + auto nonencryptedSpriteLabel = Label::create("non-encrypted", "fonts/arial.ttf", 28); nonencryptedSpriteLabel->setPosition(Point(s.width * 0.25f, nonencryptedSprite->getBoundingBox().getMinY() - nonencryptedSprite->getContentSize().height/2)); this->addChild(nonencryptedSpriteLabel, 1); @@ -65,7 +65,7 @@ void TextureAtlasEncryptionDemo::onEnter() encryptedSprite->setPosition(Point(s.width * 0.75f, s.height * 0.5f)); this->addChild(encryptedSprite); - auto encryptedSpriteLabel = LabelTTF::create("encrypted", "Arial", 28); + auto encryptedSpriteLabel = Label::create("encrypted", "fonts/arial.ttf", 28); encryptedSpriteLabel->setPosition(Point(s.width * 0.75f, encryptedSprite->getBoundingBox().getMinY() - encryptedSpriteLabel->getContentSize().height/2)); this->addChild(encryptedSpriteLabel, 1); } diff --git a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp index 16a6c1e862..68dcaabc80 100644 --- a/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp +++ b/tests/cpp-tests/Classes/TransitionsTest/TransitionsTest.cpp @@ -266,12 +266,12 @@ TestLayer1::TestLayer1(void) bg1->setPosition( Point(size.width/2, size.height/2) ); addChild(bg1, -1); - auto title = LabelTTF::create( (transitions[s_nSceneIdx]).name, "Thonburi", 32 ); + auto title = Label::create( (transitions[s_nSceneIdx]).name, "fonts/Thonburi.ttf", 32 ); addChild(title); title->setColor( Color3B(255,32,32) ); title->setPosition( Point(x/2, y-100) ); - auto label = LabelTTF::create("SCENE 1", "Marker Felt", 38); + auto label = Label::create("SCENE 1", "fonts/Marker Felt.ttf", 38); label->setColor( Color3B(16,16,255)); label->setPosition( Point(x/2,y/2)); addChild( label); @@ -395,12 +395,12 @@ TestLayer2::TestLayer2() bg1->setPosition( Point(size.width/2, size.height/2) ); addChild(bg1, -1); - auto title = LabelTTF::create((transitions[s_nSceneIdx]).name, "Thonburi", 32 ); + auto title = Label::create((transitions[s_nSceneIdx]).name, "fonts/Thonburi.ttf", 32 ); addChild(title); title->setColor( Color3B(255,32,32) ); title->setPosition( Point(x/2, y-100) ); - auto label = LabelTTF::create("SCENE 2", "Marker Felt", 38); + auto label = Label::create("SCENE 2", "fonts/Marker Felt.ttf", 38); label->setColor( Color3B(16,16,255)); label->setPosition( Point(x/2,y/2)); addChild( label); diff --git a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp index 27a5a8fa1a..45fb612c12 100644 --- a/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp +++ b/tests/cpp-tests/Classes/UserDefaultTest/UserDefaultTest.cpp @@ -8,7 +8,7 @@ UserDefaultTest::UserDefaultTest() { auto s = Director::getInstance()->getWinSize(); - auto label = LabelTTF::create("CCUserDefault test see log", "Arial", 28); + auto label = Label::create("CCUserDefault test see log", "fonts/arial.ttf", 28); addChild(label, 0); label->setPosition( Point(s.width/2, s.height-50) ); diff --git a/tests/cpp-tests/Classes/controller.cpp b/tests/cpp-tests/Classes/controller.cpp index e6213f337e..7d9d2cc036 100644 --- a/tests/cpp-tests/Classes/controller.cpp +++ b/tests/cpp-tests/Classes/controller.cpp @@ -130,14 +130,11 @@ TestController::TestController() closeItem->setPosition(Point( VisibleRect::right().x - 30, VisibleRect::top().y - 30)); // add menu items for tests + TTFConfig ttfConfig("fonts/arial.ttf", 24); _itemMenu = Menu::create(); for (int i = 0; i < g_testCount; ++i) { -// #if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE) -// auto label = LabelBMFont::create(g_aTestNames[i].c_str(), "fonts/arial16.fnt"); -// #else - auto label = LabelTTF::create( g_aTestNames[i].test_name, "Arial", 24); -// #endif + auto label = Label::createWithTTF(ttfConfig, g_aTestNames[i].test_name); auto menuItem = MenuItemLabel::create(label, CC_CALLBACK_1(TestController::menuCallback, this)); _itemMenu->addChild(menuItem, i + 10000); diff --git a/tests/cpp-tests/Classes/testBasic.cpp b/tests/cpp-tests/Classes/testBasic.cpp index 4ce2c03d04..2fc38644c1 100644 --- a/tests/cpp-tests/Classes/testBasic.cpp +++ b/tests/cpp-tests/Classes/testBasic.cpp @@ -37,11 +37,9 @@ void TestScene::onEnter() Scene::onEnter(); //add the menu item for back to main menu -//#if (CC_TARGET_PLATFORM == CC_PLATFORM_MARMALADE) -// auto label = LabelBMFont::create("MainMenu", "fonts/arial16.fnt"); -//#else - auto label = LabelTTF::create("MainMenu", "Arial", 20); -//#endif + TTFConfig ttfConfig("fonts/arial.ttf", 20); + auto label = Label::createWithTTF(ttfConfig,"MainMenu"); + auto menuItem = MenuItemLabel::create(label, testScene_callback ); auto menu = Menu::create(menuItem, NULL); diff --git a/tests/lua-empty-test/project/proj.android/AndroidManifest.xml b/tests/lua-empty-test/project/proj.android/AndroidManifest.xml index 880a984075..7c88d6ab2f 100644 --- a/tests/lua-empty-test/project/proj.android/AndroidManifest.xml +++ b/tests/lua-empty-test/project/proj.android/AndroidManifest.xml @@ -10,7 +10,7 @@ - delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/tests/lua-tests/project/proj.android/AndroidManifest.xml b/tests/lua-tests/project/proj.android/AndroidManifest.xml index 7a04f7e9fe..4570848f92 100644 --- a/tests/lua-tests/project/proj.android/AndroidManifest.xml +++ b/tests/lua-tests/project/proj.android/AndroidManifest.xml @@ -11,7 +11,7 @@ - delete - //EGL_GREEN_SIZE, 6, -->delete - //EGL_RED_SIZE, 5, -->delete - EGL_BUFFER_SIZE, 32, //-->new field - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_NONE - };*/ - - //2.Set the format of window - // getWindow().setFormat(PixelFormat.TRANSLUCENT); - - } -} diff --git a/tools/jenkins-scripts/gen_jsb.py b/tools/jenkins-scripts/gen_jsb.py index 0d18dbacf3..1403b49400 100644 --- a/tools/jenkins-scripts/gen_jsb.py +++ b/tools/jenkins-scripts/gen_jsb.py @@ -1,9 +1,16 @@ #!/usr/bin/python import os +import sys +ret = 0 genbindings_dirs = ['tolua'] for item in genbindings_dirs: os.chdir("tools/" + item) - os.system('python genbindings.py') + ret = os.system('python genbindings.py') os.chdir("../..") + if(ret != 0): + ret = 1 + break + +sys.exit(ret) diff --git a/tools/jenkins-scripts/pull-request-builder.py b/tools/jenkins-scripts/pull-request-builder.py index c9d753bffe..8b6b8909f6 100755 --- a/tools/jenkins-scripts/pull-request-builder.py +++ b/tools/jenkins-scripts/pull-request-builder.py @@ -103,16 +103,18 @@ def main(): # Generate binding glue codes if(branch == 'develop'): - os.system("python tools/jenkins-scripts/gen_jsb.py") + ret = os.system("python tools/jenkins-scripts/gen_jsb.py") elif(branch == 'master'): os.chdir('tools/tojs') if(platform.system() == 'Windows'): os.environ['NDK_ROOT'] = os.environ['NDK_ROOT_R8E'] - os.system("genbindings-win32.bat") + ret = os.system("genbindings-win32.bat") os.environ['NDK_ROOT'] = os.environ['NDK_ROOT_R9B'] else: - os.system("./genbindings.sh") + ret = os.system("./genbindings.sh") os.chdir('../..') + if(ret != 0): + return(1) #make temp dir print "current dir is: " + os.environ['WORKSPACE'] diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 9bdfe727ba..b59892321b 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -22,11 +22,11 @@ cxxgenerator_headers = extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h +headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/SimpleAudioEngine.h %(cocosdir)s/cocos/ui/CCProtectedNode.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewProtocol GLView Image Event(?!.*(Physics).*).* Component +classes = New.* Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Ref$ UserDefault GLViewProtocol GLView Image Event(?!.*(Physics).*).* Component ProtectedNode # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -44,7 +44,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS LayerColor::[getBlendFunc setBlendFunc], ParticleSystem::[getBlendFunc setBlendFunc], DrawNode::[getBlendFunc setBlendFunc drawPolygon listenBackToForeground], - Director::[getAccelerometer (g|s)et.*Dispatcher getOpenGLView getProjection getFrustum getRenderer], + Director::[getAccelerometer (g|s)et.*Dispatcher getProjection getFrustum getRenderer], Layer.*::[didAccelerate (g|s)etBlendFunc keyPressed keyReleased], Menu.*::[.*Target getSubItems create initWithItems alignItemsInRows alignItemsInColumns], MenuItem.*::[create setCallback initWithCallback], diff --git a/tools/travis-scripts/config.gitingore b/tools/travis-scripts/config.gitingore index b4153b6d07..f3a4b10172 100644 --- a/tools/travis-scripts/config.gitingore +++ b/tools/travis-scripts/config.gitingore @@ -13,7 +13,10 @@ Thumbs.db /templates /tests /plugin/samples -/tools +/tools/cocos2d-console +/tools/jenkins-scripts +/tools/make-package +/tools/travis-scripts .gitattributes .gitignore diff --git a/tools/travis-scripts/generate-template-files.py b/tools/travis-scripts/generate-template-files.py index f0a1dea422..6da3e33378 100755 --- a/tools/travis-scripts/generate-template-files.py +++ b/tools/travis-scripts/generate-template-files.py @@ -43,7 +43,7 @@ class CocosFileList: self.fileList_com=[] self.fileList_lua=[] - self.luaPath = ["cocos/scripting/lua-bindings", "external/lua"] + self.luaPath = ["cocos/scripting/lua-bindings", "external/lua", "tools/bindings-generator", "tools/tolua"] def readIngoreFile(self, fileName): """