javascript 放大缩小精灵升级版
function xuanzhuanactnew(dianthat, dianjix, dianjiy, zhongxinx, zhongxiny){ var newangle = getjiaodu(dianjix, dianjiy, zhongxinx, zhongxiny); var youxiajiajiao=dianthat.getChildByName('bunny').youxiajiajiao; var renewangle=-(newangle+Math.abs(youxiajiajiao)); dianthat.rotation = renewangle; var newjuli = getjuli(dianjix, dianjiy, zhongxinx, zhongxiny); console.group('x1'); console.log('newjuli:'+newjuli); console.log('newangle:'+newangle); console.groupEnd(); var x1 = newjuli * Math.cos(youxiajiajiao) var cwidth=Math.abs(x1)*2 var bunny = dianthat.getChildByName('bunny'); bunny.width = cwidth; fangdaact(dianthat); }
youxiajiajiao 右下角与X的夹角
如果看不懂
翻下以前的博客