misc/hats_js_anim.xhtml
changeset 15568 de1b31c2d2f2
parent 15567 f22ebcd9f3fc
child 15977 f81fe8250ed9
equal deleted inserted replaced
15567:f22ebcd9f3fc 15568:de1b31c2d2f2
   312         // Cycle through hedgehog and hat animation frames
   312         // Cycle through hedgehog and hat animation frames
   313 
   313 
   314         // Hedgehog
   314         // Hedgehog
   315         a[i].style.backgroundPosition=Math.floor(a[i].idle/16)*-32+"px "+(a[i].idle%16)*-32+"px";
   315         a[i].style.backgroundPosition=Math.floor(a[i].idle/16)*-32+"px "+(a[i].idle%16)*-32+"px";
   316 
   316 
       
   317         var maskName = a[i].title;
   317         // Hat
   318         // Hat
   318         if (staticMasks[masks[i]] === true) {
   319         if (staticMasks[maskName] === true) {
   319             // Hat offset for static hats
   320             // Hat offset for static hats
   320             if (a[i].idle === 2 || a[i].idle === 7 || a[i].idle === 12)
   321             if (a[i].idle === 2 || a[i].idle === 7 || a[i].idle === 12)
   321                 a[i].firstChild.style.marginTop="-4px";
   322                 a[i].firstChild.style.marginTop="-4px";
   322             else if (a[i].idle === 16)
   323             else if (a[i].idle === 16)
   323                 a[i].firstChild.style.marginTop="-6px";
   324                 a[i].firstChild.style.marginTop="-6px";