/**
* Places a child relative to a parent using degrees and angle from the center Point
* @param CenterX Horizontal value of parent
* @param CenterY Vertical value of parent
* @param ANGLE Angle from parent
* @param RADIUS Radius/Distance from parent
* @return FlxPoint Position of child
*/
public static function placeOnCircle(CenterX:Float, CenterY:Float, ANGLE:Float, RADIUS:Int):FlxPoint
{
var a:Float = ANGLE * (Math.PI / 180); return FlxPoint.get(CenterX + RADIUS * Math.cos(a), CenterY + RADIUS * Math.sin(a));
}
Hey - I made this method just for that a while ago:
/**
* Places a child relative to a parent using degrees and angle from the center Point
* @param CenterX Horizontal value of parent
* @param CenterY Vertical value of parent
* @param ANGLE Angle from parent
* @param RADIUS Radius/Distance from parent
* @return FlxPoint Position of child
*/
public static function placeOnCircle(CenterX:Float, CenterY:Float, ANGLE:Float, RADIUS:Int):FlxPoint
{
var a:Float = ANGLE * (Math.PI / 180);return FlxPoint.get(CenterX + RADIUS * Math.cos(a), CenterY + RADIUS * Math.sin(a));
}So this might work for you if you have the center point already.
On Monday, July 14, 2014 2:47:49 AM UTC-4, puggsoy wrote: