首页  >  问答  >  正文

javascript - tagCanvas插件无法自动播放

tagCanvas插件
这个插件好像没有自动插放的参数,有谁改过源码的?能给过来参考下吗?

源码地址

PHP中文网PHP中文网2707 天前743

全部回复(1)我来回复

  • 学习ing

    学习ing2017-06-15 09:24:25

    这插件没用过,看了下源码:

    TCproto.Draw = function() {
        var cv = this.canvas, cw = cv.width, ch = cv.height, max_sc = 0, yaw = this.yaw, pitch = this.pitch,
            x1 = cw / 2, y1 = ch / 2, c = this.ctxt, active, a, i, tl = this.taglist, l = tl.length;
        c.setTransform(1,0,0,1,0,0);
        this.active = null;
        for(i = 0; i < l; ++i)
            tl[i].Calc(yaw, pitch);
        tl = tl.sort(function(a,b) {return a.sc-b.sc});
    
        if(!this.txtOpt && this.shadow) {
            c.shadowBlur = this.shadowBlur;
            c.shadowOffsetX = this.shadowOffset[0];
            c.shadowOffsetY = this.shadowOffset[1];
        }
        c.clearRect(0,0,cw,ch);
        for(i = 0; i < l; ++i) {
            a = tl[i].Draw(c, x1, y1);
            if(a && a.sc > max_sc && (!this.frontSelect || a.z <= 0)) {
                active = a;
                active.index = i;
                max_sc = a.sc;
            }
        }
        /**在这一块**/
        if(this.freezeActive && active)
            this.yaw = this.pitch = 0;
        else
            this.Animate(cw, ch);
        /***Animate函数里面是运动计算公式,你需要调整的是在鼠标没有触发hover时也能保持动画不是freeze状态,具体代码你自己改吧***/
        active && (this.active = active).Draw(c);
    };

    回复
    0
  • 取消回复