We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Label alpha blending bug on Mac target
Label alpha blending bug on Mac target
- File Screen Shot 2014-06-20 at 4.58.58 PM.png added
This artifact occurs because the texture that the font is being rendered to is prefilled with Color4B(0, 0, 0, 0).
If you have an outline color of Color4b(255, 255, 255, 255) then the colors around the edge are being blended between 255 (white) and 0 (black).
The solution is for the texture to be prefilled with the setTextColor but with an opacity of 0. Or if an outline is present for it to be prefilled with the enableOutline color but with an opacity of 0.
This is a bug and still occurs in 3.1.1 using the cocos2d::Label class.
In the attached screen shot you can see a white outline of the font over a background asset that is also white. The black outline occurs because the blending of the outline of the text is being applied to the texture the font was rendered to (internally within the Label class) that is prefilled with black transparent pixels.
Redmine issue system is closed, we are using github issue system instead.
This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8378
Status: | Closed | |
---|---|---|
Start date: | 2014-03-21 | |
Priority: | Low | |
Due date: | ||
Assignee: | - | |
% Done: | 0% |
|
Category: | mac | |
Target version: | - |
Labels on Mac do show a alpha blending bug.
I created LabelTTF, LabelBMFont, and Label and set their color to WHITE.
They show small black borders around their outline.
Expected behaviour would be a complete white screen.
It can be fixed by setting premultiplied alpha for the label textures to 'true'. However even then their is still a very slight coloured outline.
Screen Shot 2014-03-21 at 18.40.26.png (95.5 kB) Zombie, 2014-03-21 17:42
Screen Shot 2014-06-20 at 4.58.58 PM.png (313.8 kB) hagelslaginthevalley, 2014-06-20 16:03