diff --git a/cocos2dx/label_nodes/CCTextImage.cpp b/cocos2dx/label_nodes/CCTextImage.cpp index e73a41ffc6..e39a28ef71 100644 --- a/cocos2dx/label_nodes/CCTextImage.cpp +++ b/cocos2dx/label_nodes/CCTextImage.cpp @@ -88,7 +88,8 @@ bool TextPageDef::generatePageTexture(bool releasePageData) if (!_pageTexture) return false; - bool textureCreated = _pageTexture->initWithData(_pageData, kCCTexture2DPixelFormat_Default, _width, _height, imageSize); + int dataLenght = (_width * _height * 4); + bool textureCreated = _pageTexture->initWithData(_pageData, dataLenght, Texture2D::PixelFormat::RGBA8888, _width, _height, imageSize); // _pageTexture->setPremultipliedAlpha(true);