Skip to content

(v3.0) incorrect font-fill-color when call function Device::getTextureDataForText #8430

@minggo

Description

@minggo

Note

This issue is migrated from here. It was created at 2014/05/02 16:13:45 +0000

Description

cocos2d-x 3.0
file: cocos/2d/platform/ios/CCDevice.mm, Device::getTextureDataForText

//line: 469-471
info.strokeColorR = textDefinition._stroke._strokeColor.r;
info.strokeColorG = textDefinition._stroke._strokeColor.g;
info.strokeColorB = textDefinition._stroke._strokeColor.b;
//line: 473-475
info.tintColorR = textDefinition._fontFillColor.r;
info.tintColorG = textDefinition._fontFillColor.g;
info.tintColorB = textDefinition._fontFillColor.b;

should fix as following:

//line: 469-471
info.strokeColorR = textDefinition._stroke._strokeColor.r / 255.0f;
info.strokeColorG = textDefinition._stroke._strokeColor.g / 255.0f;
info.strokeColorB = textDefinition._stroke._strokeColor.b / 255.0f;
//line: 473-475
info.tintColorR = textDefinition._fontFillColor.r / 255.0f;
info.tintColorG = textDefinition._fontFillColor.g / 255.0f;
info.tintColorB = textDefinition._fontFillColor.b / 255.0f;

textDefinition._stroke._strokeColor/_fontFillColor datatype is Color3B, as (0~255)
but info.strokeColorR/G/B is float, as (0 ~ 1.0), so need to convert it... original code seems missing.

Thanks.

  • macbearchen added comment:
    cocos2d-x 3.2
    [FIX] Label: color can not be set correctly if using system font on iOS

BUT NOT FIXED "STROKE COLOR" in info.strokeColorRGB....
My suggestion could fixed it, BUT not be noticed.... :(

  • macbearchen added comment:
    cocos2d-x 3.2
    [FIX] Label: color can not be set correctly if using system font on iOS

    BUT NOT FIXED "STROKE COLOR" in info.strokeColorRGB....

My suggestion could fixed it, BUT not be noticed.... :(

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions