在flash8放大或者缩小时,怎么让中心点不动
答案:2 悬赏:50
解决时间 2021-02-19 22:32
- 提问者网友:风华是一指流沙
- 2021-02-19 01:52
意思就是,原图的重心点,不会因为我的放大、缩小被改变·
最佳答案
- 二级知识专家网友:修女的自白
- 2021-02-19 02:29
一般放大或者缩小时,中心点不动是不动的,不过可以按着 ALT 试试
全部回答
- 1楼网友:陪我到地狱流浪
- 2021-02-19 02:44
import flash.display.movieclip;
import flash.geom.point;
import flash.events.mouseevent;
image.addeventlistener(mouseevent.click,clickhandler);
function clickhandler(event:mouseevent):void{
var mc:movieclip=event.currenttarget as movieclip;
var point:point = new point(mc.mousex,mc.mousey);
scaleatpoint(mc,point,mc.scalex+1);
}
function scaleatpoint(target:movieclip,point:point,scale:number):void{
var stagepoint:point = target.localtoglobal(point);
target.scalex=target.scaley=scale;
var currentstagepoint:point = target.localtoglobal(point);
target.x-=currentstagepoint.x-stagepoint.x;
target.y-=currentstagepoint.y-stagepoint.y;
}
如果有需要也可以配合tweenlite来添加缩放动画
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯