javascript - tagCanvas插件无法自动播放
PHP中文网
PHP中文网 2017-06-15 09:22:25
[JavaScript讨论组]

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

源码地址

PHP中文网
PHP中文网

认证0级讲师

全部回复(1)
学习ing

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

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);
};
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号