cocos2dx 问题求助
2017-03-09 23:32:43 +08:00
bitpest
init: function() {
this._super();
var a = this;
this._carNumberSpr = [];
this._carNumberMask = [];
this._curData = [];
this._nextData = [];
this._winSize = cc.Director.getInstance().getWinSize();
this._paoDaoSprite = cc.Sprite.create(s_PaoDao);
this._paoDaoSprite.setPosition(cc.p(-1200, .5 * this._winSize.height));
this.addChild(this._paoDaoSprite, 0);
this._qian = cc.Sprite.create(g_qianmi);
this._qian.setPosition(cc.p(-200, .5 * this._winSize.height - 30));
this.addChild(this._qian, 100);
this._carMgrLayer = new CarManagerLayer;
this._carMgrLayer.init();
this._carMgrLayer.defaultInitCar();
this._carMgrLayer.setPosition(cc.p(100, 0));
this.addChild(this._carMgrLayer, 1);
this._timeNumber = "";
this._timeLable = cc.LabelTTF.create(this._timeNumber, "Arial", 38);
this._timeLable.setPosition(cc.p(.5 * this._winSize.width, this._winSize.height / 2));
this.addChild(this._timeLable, 7);
this._topLayer = new firstTopDisLayer;
this._topLayer.init();
this._topLayer.setPosition(cc.p(490, 595));
this.addChild(this._topLayer);
this._btmLayer = new firstBtmDisLayer;
this._btmLayer.init();
this._btmLayer.setPosition(cc.p(490, 48));
this.addChild(this._btmLayer, 100);
for (var b = 0; 10 > b; b++) {
var c = cc.Sprite.create(numberIndexSrc[b]);
c.setPosition(cc.p(65 * b + 170, 595));
this.addChild(c, 4);
this._carNumberSpr[b] = c
}
this._bgNumber = cc.Sprite.create(g_bgTimePro);
this._bgNumber.setPosition(cc.p(560, 320));
this.addChild(this._bgNumber, 6);
$.getJSON(g_hostIp, function(b) {
a._topLayer._qishuLable.setString(b.current.periodNumber);
a._topLayer._nextQishuLable.setString(b.next.periodNumber);
a._topLayer._nextTimeLable.setString(formatData(b.next.awardTime, b.next.delayTimeInterval));
a._btmLayer._curDate.setString(b.current.awardTime, cc.p(-370, -25), 24);
a._btmLayer._curQihao.setString(b.current.periodNumber, cc.p(-174, -25), 24);
a._curPed = b.current.periodNumber;
a._nextPed = b.next.periodNumber;
if (null != b.next.awardNumbers || "" != b.next.awardNumbers) {
var c = [],
c = b.current.awardNumbers.split(",");
a._btmLayer.setCurData(c);
g_isAddMaskSpr && a.initCarMask(c)
}
var c = b.next.awardTimeInterval,
f = b.next.awardTimeInterval / 1E3,
f = f + Number(b.next.delayTimeInterval);
a._timeNumber = f.toFixed(0);
0 < c ? (f += 6, a._timeNumber = f.toFixed(0), a._timeLable.setString(a._timeNumber), a.schedule(a.timeLableRunning, 1)) : (a._timeNumber = 6, a._timeLable.setString(a._timeNumber), a.schedule(a.timeLableRunning, 1))
});
this.adjustSizeForWindow()
},
现在想修改 s_PaoDao 的位置,想让他下移一点,该怎么修改下
0 条回复
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/346290
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.