小编Sha*_*sia的帖子

Cocos2d在Chrome和Firefox中进行文本对齐

这就是它在chrome和mozilla中的外观

我正在使用cocos2dx-3.10

我用过这段代码

var TestLayer = cc.LayerColor.extend({
    ctor: function () {
        this._super(cc.color(255, 255, 255));


        var lineUp = new cc.DrawNode();
        lineUp.drawSegment(cc.p(0, 0), cc.p(200, 0), 0.5, cc.color(80, 80, 80));
        lineUp.setPosition(cc.p(this.width / 2 - 100, this.height / 2 + 13));
        this.addChild(lineUp);

        var lineDown = new cc.DrawNode();
        lineDown.drawSegment(cc.p(0, 0), cc.p(200, 0), 0.5, cc.color(80, 80, 80));
        lineDown.setPosition(cc.p(this.width / 2 - 100, this.height / 2 - 17));
        this.addChild(lineDown);

        var label = new cc.LabelTTF("Lorem Ipsum", "Arial", 30);
        label.setColor(cc.color(0, 0, 0));
        label.setPosition(cc.p(this.width / 2, this.height / 2));
        this.addChild(label); …
Run Code Online (Sandbox Code Playgroud)

javascript cocos2d-x html5-canvas cocos2d-js

5
推荐指数
0
解决办法
160
查看次数

标签 统计

cocos2d-js ×1

cocos2d-x ×1

html5-canvas ×1

javascript ×1