Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DrawBuildEffect (Cairo.Context context, Gdk.Rectangle area, float progress)
- {
- CairoExtensions.RoundedRectangle (context, area.X + .5, area.Y + .5, area.Width - 1, area.Height - 1, 3);
- context.Clip ();
- Gdk.Point center = new Gdk.Point (area.Right - 100, area.Bottom - 10);
- context.Translate (center.X, center.Y);
- var circles = new List<Tuple<int, int, int, double>> {
- new Tuple<int, int, int, double> (25, 15, 1, Math.PI * 1.5),
- new Tuple<int, int, int, double> (30, 9, 2, Math.PI * 1.5),
- new Tuple<int, int, int, double> (45, 15, 3, Math.PI * .5),
- new Tuple<int, int, int, double> (60, 6, 1, Math.PI * 1.75),
- new Tuple<int, int, int, double> (75, 15, 2, Math.PI * .75),
- new Tuple<int, int, int, double> (90, 5, 2, Math.PI * 1),
- new Tuple<int, int, int, double> (100, 25, 1, Math.PI * 1.5),
- new Tuple<int, int, int, double> (120, 35, 3, Math.PI * .5),
- };
- foreach (var arc in circles) {
- context.Rotate (Math.PI * 2 * progress * arc.Item3);
- context.MoveTo (arc.Item1, 0);
- context.Arc (0, 0, arc.Item1, 0, arc.Item4);
- context.LineWidth = arc.Item2;
- context.Color = new Color (0, 0, 0, 0.05);
- context.Stroke ();
- context.Rotate (Math.PI * 2 * -progress * arc.Item3);
- progress = -progress;
- }
- context.LineWidth = 1;
- context.ResetClip ();
- }
Add Comment
Please, Sign In to add comment