I've been struggling with this for a while now: how to pull off dragging a sprite and constraining its position to paths between the points of a geometric shape (in this case a triangle). I'm currently using a formula to set an X/Y angle of drag relative to the position of the center of the triangle, but it would be so much easier if I could just feed some points to a function.
Another option I considered was tracking the position/rotation of a sprite dragged radially around a center point within the triangle, and figuring out the sprite's point of intersection with the triangle's sides, but couldn't figure out the math for this.
Trying to accomplish dragging like this:
i-view.net/construct-shots/tri-drag.gif
Any suggestions?