Ejemplo n.º 1
0
        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            base.Draw (gr, area_width, area_height, rtl);

            if (problems[problem].single)
                gr.DrawImageFromAssembly ("dice.svg", 0.3, 0.3, 0.4, 0.4);
            else {
                gr.DrawImageFromAssembly ("dice.svg", 0.1, 0.3, 0.4, 0.4);
                gr.DrawImageFromAssembly ("dice.svg", 0.5, 0.3, 0.4, 0.4);
            }
        }
Ejemplo n.º 2
0
        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            base.Draw (gr, area_width, area_height, rtl);

            if (gametype == GameType.Present) {
                gr.DrawImageFromAssembly ("present.svg", 0.2, 0.4, 0.6, 0.2);
            } else {
                if (gametype == GameType.Fence)
                {
                    double x105, y105, y;
                    const double x = 0.35;
                    const double figure_size = 0.4;

                    x105 = figure_size * Math.Cos (105 * Math.PI / 180);
                    y105 = figure_size * Math.Sin (105 * Math.PI / 180);

                    y = (1 - y105) / 2;
                    gr.MoveTo (x, y);
                    gr.LineTo (x + x105, y + y105);
                    gr.LineTo (x + x105 + figure_size, y + y105);
                    gr.Stroke ();
                    gr.MoveTo (x + figure_size, y);
                    gr.LineTo (x + figure_size + x105, y + y105);
                    gr.Stroke ();
                    gr.MoveTo (x, y);
                    gr.LineTo (x + figure_size, y);
                    gr.Stroke ();
                }
            }
        }
Ejemplo n.º 3
0
        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            base.Draw (gr, area_width, area_height, rtl);

            if (String.IsNullOrEmpty (svg_image) == false)
                gr.DrawImageFromAssembly (svg_image, 0.25, 0.25, 0.5, 0.5);
        }
Ejemplo n.º 4
0
        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            base.Draw (gr, area_width, area_height, rtl);
            gr.DrawImageFromAssembly ("people_table.svg", 0.2, 0.2, 0.6, 0.6);

            gr.DrawTextCentered (0.5, 0.85,
                Translations.GetString ("Two people in the table sitting across each other"));
        }
Ejemplo n.º 5
0
        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            string train_right = "train_right.svg";
            string train_left = "train_left.svg";

            base.Draw (gr, area_width, area_height, rtl);

            switch (gametype)
            {
            case GameType.Overtake:
                gr.DrawImageFromAssembly (train_right, 0, 0.1, 0.5, 0.55);
                gr.MoveTo (0.1, 0.45);
                gr.LineTo (0.9, 0.45);
                gr.Stroke ();

                gr.DrawImageFromAssembly (train_right, 0.5, 0.1, 0.5, 0.55);
                break;

            case GameType.Meet:
                gr.DrawImageFromAssembly (train_right, 0, 0.1, 0.5, 0.55);
                gr.MoveTo (0.1, 0.45);
                gr.LineTo (0.9, 0.45);
                gr.Stroke ();

                gr.DrawImageFromAssembly (train_left, 0.55, 0.3, 0.5, 0.55);
                gr.MoveTo (0.1, 0.65);
                gr.LineTo (0.9, 0.65);
                gr.Stroke ();
                break;

            case GameType.Apart:
                gr.DrawImageFromAssembly (train_right, 0.35, 0.1, 0.5, 0.55);
                gr.MoveTo (0.1, 0.45);
                gr.LineTo (0.9, 0.45);
                gr.Stroke ();

                gr.DrawImageFromAssembly (train_left, 0.15, 0.3, 0.5, 0.55);
                gr.MoveTo (0.1, 0.65);
                gr.LineTo (0.9, 0.65);
                gr.Stroke ();
                break;
            default:
                throw new Exception ("Unexpected value");
            }
        }
Ejemplo n.º 6
0
 public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
 {
     base.Draw (gr, area_width, area_height, rtl);
     gr.DrawImageFromAssembly ("handshake.svg", 0.2, 0.6, 0.6, 0.3);
 }
Ejemplo n.º 7
0
        public void DrawBalance(CairoContextEx gr, double x, double y, int index, bool full)
        {
            const double width = 0.5;
            double fig_x = x + 0.1, fig_y = y - 0.08;
            int total = (full == true) ? (elements * 2) : elements;

            for (int i = 0; i < total; i++) {
                switch (balances[i + index]) {
                case 1:
                    gr.DrawEquilateralTriangle (fig_x, fig_y, 0.05);
                    break;
                case 2:
                    gr.Arc (fig_x + (0.05 / 2), fig_y + (0.05 / 2) + 0.003, (0.05 / 2), 0, 2 * Math.PI);
                    gr.Stroke ();
                    break;
                case 3:
                    gr.Rectangle (fig_x, fig_y + 0.005, 0.045, 0.045);
                    gr.Stroke ();
                    break;
                }

                if (i == elements - 1)
                    fig_x = x + 0.54;
                else
                    fig_x += 0.07;
            }

            gr.DrawImageFromAssembly ("balance.svg", x + 0.02, y - 0.08, 0.9, 0.25);
        }
Ejemplo n.º 8
0
        private void DrawFigure(CairoContextEx gr, double x, double y, Face fig)
        {
            double space_x, space_y;
            string image;

            space_x = (rect_w - figure_size) / 2;
            space_y = (rect_h - figure_size) / 2;

            switch (fig) {
            case Face.FaceBoy1:
                image = "faceboy1.svg";
                break;
            case Face.FaceBoy2:
                image = "faceboy2.svg";
                break;
            case Face.FaceBoy3:
                image = "faceboy3.svg";
                break;
            case Face.FaceGirl1:
                image = "facegirl1.svg";
                break;
            case Face.FaceGirl2:
                image = "facegirl2.svg";
                break;
            case Face.FaceGirl3:
                image = "facegirl3.svg";
                break;
            default:
                throw new InvalidOperationException("Invalid value");
            }
            gr.DrawImageFromAssembly (image, x + space_x, y + space_y, figure_size, figure_size);
        }