private static SKPoint GetDrawPosition(SKRect pBounds, SKRect DrawSize, MenuHorizontalAlignment pAlign) { float useX = GetDrawX(pBounds, DrawSize, pAlign); float useY = (pBounds.Top + pBounds.Height / 2 - (DrawSize.Height / 2)); return(new SKPoint(useX, useY + DrawSize.Height)); }
private static float GetDrawX(SKRect pBounds, SKRect DrawSize, MenuHorizontalAlignment pAlign) { switch (pAlign) { case MenuHorizontalAlignment.Center: return((pBounds.Left + pBounds.Width / 2) - DrawSize.Width / 2); case MenuHorizontalAlignment.Left: return(pBounds.Left); case MenuHorizontalAlignment.Right: return(pBounds.Right - DrawSize.Height); } return(0); }