学习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);
};