Map 地图的缩放公式,以便缩放时用户选择中心-闪烁

Map 地图的缩放公式,以便缩放时用户选择中心-闪烁,map,mapping,actionscript-2,Map,Mapping,Actionscript 2,成分: - one vector map - one masked viewing area - one slider taking the map from 100% to 600% - map is draggable - map movieclip center is the top left of the movieclip 比方说,放大、拖动地图,使右下象限位于查看区域,然后缩小 问题是: 因为地图的中心是电影剪辑的左上角,所以从该点开始缩放。缩放时如何保持中心点为视图区域上的中心点

成分:

- one vector map
- one masked viewing area
- one slider taking the map from 100% to 600%
- map is draggable
- map movieclip center is the top left of the movieclip
比方说,放大、拖动地图,使右下象限位于查看区域,然后缩小

问题是:
因为地图的中心是电影剪辑的左上角,所以从该点开始缩放。缩放时如何保持中心点为视图区域上的中心点?

缩放地图后,可以重新定位地图,使其中心与遮罩中心匹配

//assuming map is the name of your map clip, and mapMask the name of the mask
map.x = mapMask.x + mapMask.width * .5 - map.width * .5;
map.y = mapMask.y + mapMask.height * .5 - map.height * .5;
因为遮罩总是比遮罩大,所以应该这样做


祝你好运

我认为你的问题很难回答。我建议你把问题的措辞改得更具体一些。