tagCanvas插件
這個(gè)插件好像沒有自動(dòng)插放的參數(shù),有誰改過源碼的?能給過來參考下嗎?
源碼地址
認(rèn)證0級(jí)講師
這插件沒用過,看了下源碼:
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函數(shù)里面是運(yùn)動(dòng)計(jì)算公式,你需要調(diào)整的是在鼠標(biāo)沒有觸發(fā)hover時(shí)也能保持動(dòng)畫不是freeze狀態(tài),具體代碼你自己改吧***/
active && (this.active = active).Draw(c);
};