Guest User

Untitled

a guest
Dec 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. void DrawBuildEffect (Cairo.Context context, Gdk.Rectangle area, float progress)
  2. {
  3. CairoExtensions.RoundedRectangle (context, area.X + .5, area.Y + .5, area.Width - 1, area.Height - 1, 3);
  4. context.Clip ();
  5.  
  6. Gdk.Point center = new Gdk.Point (area.Right - 100, area.Bottom - 10);
  7. context.Translate (center.X, center.Y);
  8. var circles = new List<Tuple<int, int, int, double>> {
  9. new Tuple<int, int, int, double> (25, 15, 1, Math.PI * 1.5),
  10. new Tuple<int, int, int, double> (30, 9, 2, Math.PI * 1.5),
  11. new Tuple<int, int, int, double> (45, 15, 3, Math.PI * .5),
  12. new Tuple<int, int, int, double> (60, 6, 1, Math.PI * 1.75),
  13. new Tuple<int, int, int, double> (75, 15, 2, Math.PI * .75),
  14. new Tuple<int, int, int, double> (90, 5, 2, Math.PI * 1),
  15. new Tuple<int, int, int, double> (100, 25, 1, Math.PI * 1.5),
  16. new Tuple<int, int, int, double> (120, 35, 3, Math.PI * .5),
  17. };
  18.  
  19. foreach (var arc in circles) {
  20. context.Rotate (Math.PI * 2 * progress * arc.Item3);
  21. context.MoveTo (arc.Item1, 0);
  22. context.Arc (0, 0, arc.Item1, 0, arc.Item4);
  23. context.LineWidth = arc.Item2;
  24. context.Color = new Color (0, 0, 0, 0.05);
  25. context.Stroke ();
  26. context.Rotate (Math.PI * 2 * -progress * arc.Item3);
  27.  
  28. progress = -progress;
  29. }
  30.  
  31. context.LineWidth = 1;
  32. context.ResetClip ();
  33. }
Add Comment
Please, Sign In to add comment