cocos2dx3.0描边错乱问题

加了描边后,文字会显示错乱,求解救。下面那个图是没加描边的。
PS:chinese字体是幼圆改名,也试过黑体,一样会这样。另外,不是第一次描边会这样,是描边达到一定次数之后才出现的。

代码如下:

function createTextFieldBySize(str_label, width, font_size,  x, y, point)
    local label = cc.Label:createWithTTF(str_label, "fonts/chinese.ttf", font_size)
    label:setTextColor(cc.c4b(0xFF, 0xFF, 0xFF, 0xFF))
    label:enableOutline(cc.c4b(0x5F, 0x30, 0x1E, 0xFF), 2)
    label:enableGlow(cc.c4b(1, 42, 67, 255))
    if point ~= nil then
        label:setAnchorPoint(point)
    end
    if width ~= nil then
        local label_width = label:getContentSize().width
        local label_height = label:getContentSize().height
        if label_width > width then
            local line_num = math.ceil(label_width/width)
            label:setContentSize(cc.size(width, label_height*line_num))
            label:setWidth(width)
            -- label:setHeight(label_height*line_num)
        end
    end
    if x ~= nil and y ~= nil then
        label:setPosition(cc.p(x, y))
    end
    return label
end

```


把这句去掉就不会乱掉
label:enableOutline(cc.c4b(0x5F, 0x30, 0x1E, 0xFF), 2)

```

别人都没遇到过吗?还是说不是用ttf描边的

我也遇到这种问题,只是没这么严重。描边的文字有截断现象。

版本是cocos2d-x-3.2 Jul.17 2014

初始化方法如下:
TTFConfig ttfConfig(“PixelMplus12-Bold.ttf”,20,GlyphCollection::DYNAMIC);
ttfConfig.customGlyphs = nullptr;
descripLabel = Label::createWithTTF(ttfConfig, textString);
descripLabel->setTextColor(Color4B(Color3B(0x33,0x33,0x33)));
descripLabel->enableOutline(Color4B(Color3B(0xff,0xff,0xff)),2.0);
descripLabel->setLineHeight(35.0f);
descripLabel->setDimensions(550, 100);

— Begin quote from ____

引用第2楼dujia于2014-09-03 15:19发表的 :
我也遇到这种问题,只是没这么严重。描边的文字有截断现象。 http://www.cocoachina.com/bbs/job.php?action=topost&tid=226832&pid=1045393

— End quote

这种我也遇到了,感觉描边挺多问题,有大神能拯救一下么?

字体是一个库很基础的东西。。,3.2的描边的计算估计还得改进啊。。。 问题跟字体,描边大小设定似乎都有关

没有办法可以解决么?

今天无意中尝试了一下3.2的描边,发现没有问题了。。。下面是3.2的

描边字是哪个类?

3.0确实有问题,,我遇到过。。

描边 使用的字库文件 单独 设立一个 。,可以解决。

还是换3.2吧

这个问题解决了嘛?能分享下嘛?
ps。我在3.2帮下也是有这个问题的,悲催呀

试试这个方法。

:867:牛,确实有用

TTFConfig config(“fonts/Marker Felt.ttf”,60);
auto label1=Label::createWithTTF(config, “Alignment\nnew line”,TextHAlignment::LEFT);
label1->setPosition(1024,768);
label1->setColor(Color3B::RED);
this->addChild(label1);
label1->enableShadow(Color4B::GREEN);
label1->enableGlow(Color4B(Color3B::GREEN));
label1->enableOutline(Color4B(Color3B::BLACK));
这样写了之后发现阴影仍然是黑色的。发光和描边都没有实现。刚开始写成Color4B::GREEN同样没有实现效果
是哪个地方写错了吗

将label1->setColor(Color3B::RED); 改成 label1->setTextColor(Color4B);试试