这是它在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);
}
});