V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
bitpest
V2EX  ›  问与答

cocos2dx 问题求助

  •  
  •   bitpest · 2017-03-09 23:32:43 +08:00 · 1511 次点击
    这是一个创建于 2823 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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 的位置,想让他下移一点,该怎么修改下
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2585 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 04:18 · PVG 12:18 · LAX 20:18 · JFK 23:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.