作者tk5301 (小猪)
看板Flash
标题[问题] 拼图吸附效果?
时间Fri Dec 7 06:56:10 2012
请问该如何制作拼图自动吸附效果?
设定碰撞之後,图片都无法达到正确的位置
希望能为我解答一下,谢谢!!
PS.我才刚开始学FLASH,希望大家帮帮忙
以下为程式码
a1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
function fl_MouseClickHandler_2(event:MouseEvent):void
{
if(a1.hitTestPoint(AA.x,AA.y,true)){
trace(" 碰撞")
trace(AA.x,AA.y)
a1.x=AA.x=320.55;
a1.y=AA.y=276.5;
trace(a1.x,a1.y)
}else{trace("没碰到")}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.170.19.81
1F:推 silase0201:var tx = (a.x+b.x)*0.5 12/08 10:25
2F:→ silase0201:a.x = tx+(0.5*a.width) 12/08 10:25
3F:→ silase0201:b.x = tx+(0.5*a.width) 12/08 10:26
4F:→ silase0201:打错 b.x = tx-(0.5*b.width) 12/08 10:26
5F:→ m87dd05:我之前做过类似的我是用startDrag跟stopDrag 12/13 21:16