actionscript 3 - AS3 change line curve -
i have end part of code, need bend in opposite directon. creates line point mouse curves up. need curve down. values change this?
if ((mousex-targetpointx<0 && mousey-targetpointy>0) || (mousex-targetpointx>=0 && mousey-targetpointy<=0)) { if (mousey-targetpointy>0) { line.moveto(mousex-offset,mousey-offset); line.curveto(mousex-offset,targetpointy-offset,targetpointx-offset,targetpointy-offset); line.lineto(targetpointx+offset,targetpointy+offset); line.curveto(mousex+offset,targetpointy+offset,mousex+offset,mousey+offset); } else { line.moveto(mousex-offset,mousey-offset); line.curveto(targetpointx-offset,mousey-offset,targetpointx-offset,targetpointy-offset); line.lineto(targetpointx+offset,targetpointy+offset); line.curveto(targetpointx+offset,mousey+offset,mousex+offset,mousey+offset); } } else { if (mousex<targetpointx && mousey<targetpointy) { line.moveto(mousex-offset,mousey+offset); line.curveto(targetpointx-offset,mousey+offset,targetpointx-offset,targetpointy+offset); line.lineto(targetpointx+offset,targetpointy-offset); line.curveto(targetpointx+offset,mousey-offset,mousex+offset,mousey-offset); } else { line.moveto(mousex-offset,mousey+offset); line.curveto(mousex-offset,targetpointy+offset,targetpointx-offset,targetpointy+offset); line.lineto(targetpointx+offset,targetpointy-offset); line.curveto(mousex+offset,targetpointy-offset,mousex+offset,mousey-offset); } } line.endfill(); } }
you need change control points in curveto
methods, first 2 parameters.
curveto(controlpointx,controlpointy,targetx,targety);
Comments
Post a Comment