当前位置: 首页>>代码示例>>C#>>正文


C# CairoContextEx.LineTo方法代码示例

本文整理汇总了C#中gbrainy.Core.Main.CairoContextEx.LineTo方法的典型用法代码示例。如果您正苦于以下问题:C# CairoContextEx.LineTo方法的具体用法?C# CairoContextEx.LineTo怎么用?C# CairoContextEx.LineTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gbrainy.Core.Main.CairoContextEx的用法示例。


在下文中一共展示了CairoContextEx.LineTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = DrawAreaX + 0.2, y = DrawAreaY + 0.2, width = 0.4, height = 0.4;

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

            gr.Rectangle (x, y, width, height);
            gr.Stroke ();

            gr.MoveTo (x, y + 0.1);
            gr.LineTo (x + width, y + 0.1);  // First horizontal
            gr.Stroke ();

            gr.MoveTo (x, y + 0.3);
            gr.LineTo (x + width - 0.1, y + 0.3); // Second horizontal
            gr.Stroke ();

            gr.MoveTo (x + 0.1, y);
            gr.LineTo (x + 0.1, y + height);  // First vertical
            gr.Stroke ();

            gr.MoveTo (x + 0.3, y);
            gr.LineTo (x + 0.3, y + height - 0.1);  // Second vertical
            gr.Stroke ();
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:25,代码来源:PuzzleSquareSheets.cs

示例2: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = DrawAreaX + 0.1, y = DrawAreaY + 0.2;
            const double witdh = 0.6, height = 0.5;

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

            gr.MoveTo (x, y);
            gr.LineTo (x + witdh, y);
            gr.LineTo (x + witdh / 2, y + height / 2);
            gr.LineTo (x, y);
            gr.LineTo (x + 0.45, y + height /4);
            gr.Stroke ();

            if (type == 0) {
                gr.MoveTo (x + witdh / 2, y);
                gr.LineTo (x + witdh / 2, y + height / 2);
                gr.Stroke ();
            }

            gr.MoveTo (x + 0.152, y + 0.125);
            gr.LineTo (x + witdh, y);
            gr.Stroke ();

            if (Answer.Draw == false)
                return;

            // References
            gr.MoveTo (x - 0.02, y);
            gr.ShowPangoText ("a");

            gr.MoveTo (x + witdh /2  - 0.02, y);
            gr.ShowPangoText ("b");

            gr.MoveTo (x + witdh, y);
            gr.ShowPangoText ("c");

            gr.MoveTo (x + witdh /2  - 0.03, y + 0.07 - 0.02);
            gr.ShowPangoText ("d");

            gr.MoveTo (x + 0.11, y + 0.16);
            gr.ShowPangoText ("e");

            gr.MoveTo (x + 0.47, y + 0.16);
            gr.ShowPangoText ("f");

            gr.MoveTo (x + (witdh /2) - 0.01, y + 0.26);
            gr.ShowPangoText ("g");
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:49,代码来源:PuzzleTriangles.cs

示例3: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = 0.25, y = 0.25;

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

            gr.Rectangle (x, y, width, height);
            gr.Stroke ();

            gr.MoveTo (x, y + height / 2);
            gr.LineTo (x + width, y + height / 2);
            gr.Stroke ();

            gr.MoveTo (x + width / 2, y);
            gr.LineTo (x + width / 2, y + height);
            gr.Stroke ();

            if (cover_zone1)
                CoverZone (gr, x, y);

            if (cover_zone2)
                CoverZone (gr, x + width / 2, y);

            if (cover_zone3)
                CoverZone (gr, x, y + height / 2);

            if (cover_zone4)
                CoverZone (gr, x + width / 2, y + height / 2);

            switch (partial_zone) {
                case 1:
                    break;
                case 2:
                    x += width / 2;
                    break;
                case 3:
                    y += height / 2;
                    break;
                case 4:
                    y += height / 2;
                    x += width / 2;
                    break;
            }

            DrawSection (gr, x, y);
        }
开发者ID:GNOME,项目名称:gbrainy,代码行数:46,代码来源:PuzzleCoverPercentage.cs

示例4: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            const double aligned_pos = 0.58;

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

            gr.SetPangoLargeFontSize ();
            gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.2, number_a.ToString ());
            gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.3, number_b.ToString ());
            gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.4, number_c.ToString ());

            gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.5);
            gr.LineTo (DrawAreaX + 0.5, DrawAreaY + 0.5);
            gr.Stroke ();

            gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.55, total.ToString ());

            gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.25);
            gr.ShowPangoText ((Answer.Draw == true) ? oper1.ToString () : "?");

            gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.35);
            gr.ShowPangoText ((Answer.Draw == true) ?  oper2.ToString () : "?");
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:23,代码来源:CalculationOperator.cs

示例5: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            const double fraction_size = 0.17;
            double x =  0.5  - (fractions_num * fraction_size / 2), y = DrawAreaY + 0.3;
            const double offset_x = 0.12;

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

            gr.SetPangoLargeFontSize ();

            for (int i = 0; i < fractions_num; i++)
            {
                // Numerator
                gr.DrawTextAlignedRight (x + offset_x, y, fractions[i].Numerator.ToString ());

                // Sign
                gr.MoveTo (x, y + 0.04);
                switch (fractions[i].Operation) {
                case Operation.Addition:
                    gr.ShowPangoText ("+");
                    break;
                case Operation.Subtraction:
                    gr.ShowPangoText ("-");
                    break;
                }
                gr.Stroke ();

                // Line
                gr.MoveTo (x + 0.05, y + 0.08);
                gr.LineTo (x + offset_x + 0.02,  y + 0.08);
                gr.Stroke ();

                // Denominator
                gr.DrawTextAlignedRight (x + offset_x, y + 0.1, fractions[i].Denominator.ToString ());

                x += fraction_size;
            }
        }
开发者ID:GNOME,项目名称:gbrainy,代码行数:38,代码来源:CalculationFractions.cs

示例6: DrawQuestion

        void DrawQuestion(CairoContextEx gr, double x, double y)
        {
            gr.Rectangle (x, y, width, height);
            gr.Stroke ();

            gr.MoveTo (x, y + 0.1);
            gr.LineTo (x + width, y + 0.1);  // Container square
            gr.Stroke ();

            gr.MoveTo (x, y + 0.3);
            gr.LineTo (x + width - 0.1, y + 0.3); // Second horizontal
            gr.Stroke ();

            gr.MoveTo (x + 0.1, y);
            gr.LineTo (x + 0.1, y + height);  // First vertical
            gr.Stroke ();

            gr.MoveTo (x + 0.3, y);
            gr.LineTo (x + 0.3, y + height - 0.1);  // Second vertical
            gr.Stroke ();
        }
开发者ID:GNOME,项目名称:gbrainy,代码行数:21,代码来源:PuzzleSquareSheets.cs

示例7: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double first_x = DrawAreaX + 0.05;
            double first_y = DrawAreaY + 0.1;
            const double space_fromrect = 0.02, space_fromcircle = 0.01;
            int circles = 8;
            const double unit = 0.0625;

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

            gr.Rectangle (first_x, first_y, unit * 8, unit * 8);
            gr.Stroke ();

            // |-------|
            gr.MoveTo (first_x, first_y - 0.04 - space_fromrect);
            gr.LineTo (first_x, first_y - space_fromrect);
            gr.Stroke ();
            gr.MoveTo (first_x, first_y - 0.02 - space_fromrect);
            gr.LineTo (first_x + 0.5, first_y - 0.02 - space_fromrect);
            gr.Stroke ();
            gr.MoveTo (first_x + 0.5, first_y - 0.04 - space_fromrect);
            gr.LineTo (first_x + 0.5, first_y - space_fromrect);
            gr.Stroke ();

            gr.MoveTo (first_x + 0.2, first_y - 0.06 - space_fromrect);
            gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("8 units"));
            gr.Stroke ();

            //  ---
            //	 |
            //	 |
            //	 |
            //  ---
            gr.MoveTo (first_x  - space_fromrect, first_y);
            gr.LineTo (first_x  - space_fromrect - 0.04, first_y);
            gr.Stroke ();
            gr.MoveTo (first_x - space_fromrect - 0.02, first_y);
            gr.LineTo (first_x - space_fromrect - 0.02, first_y + 0.5);
            gr.Stroke ();
            gr.MoveTo (first_x - space_fromrect, first_y + 0.5);
            gr.LineTo (first_x - space_fromrect - 0.04, first_y + 0.5);
            gr.Stroke ();

            gr.MoveTo (first_x - space_fromrect - 0.07, first_y + 0.3);
            gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("8 units"), false, -1, 270 * Math.PI/180);
            gr.Stroke ();

            // Sample circle
            gr.Arc (first_x + 0.7, first_y + 0.1, unit / 2, 0, 2 * Math.PI);
            gr.Stroke ();

            // |-------|
            gr.MoveTo (first_x + 0.65, first_y + 0.05 - 0.04 - space_fromcircle);
            gr.LineTo (first_x + 0.65, first_y + 0.05 - space_fromcircle);
            gr.Stroke ();
            gr.MoveTo (first_x + 0.65, first_y + 0.05 - 0.02 - space_fromcircle);
            gr.LineTo (first_x + 0.65 + 0.1, first_y + 0.05 - 0.02 - space_fromcircle);
            gr.Stroke ();
            gr.MoveTo (first_x + 0.65 + 0.1, first_y + 0.05 - 0.04 - space_fromcircle);
            gr.LineTo (first_x + 0.65 + 0.1, first_y + 0.05 - space_fromcircle);
            gr.Stroke ();

            gr.MoveTo (first_x + 0.65, first_y - 0.04 - space_fromcircle);
            gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("1 unit"));
            gr.Stroke ();

            //  ---
            //	 |
            //	 |
            //	 |
            //  ---
            gr.MoveTo (first_x + 0.65  - space_fromcircle, first_y + 0.05);
            gr.LineTo (first_x + 0.65  - space_fromcircle - 0.04, first_y + 0.05);
            gr.Stroke ();
            gr.MoveTo (first_x + 0.65 - space_fromcircle - 0.02, first_y + 0.05);
            gr.LineTo (first_x + 0.65 - space_fromcircle - 0.02, first_y  + 0.05 + 0.1);
            gr.Stroke ();
            gr.MoveTo (first_x + 0.65 - space_fromcircle, first_y + 0.1 + 0.05);
            gr.LineTo (first_x + 0.65 - space_fromcircle - 0.04, first_y + 0.1 + 0.05);
            gr.Stroke ();

            gr.MoveTo (first_x + 0.65 - space_fromcircle - 0.08, first_y + 0.15);
            gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("1 unit"), false, -1, 270 * Math.PI/180);
            gr.Stroke ();

            if (Answer.Draw == false)
                return;

            double x;
            for (int line = 0; line < 9; line++)
            {
                for (int circle = 0; circle < circles; circle++)
                {
                    x = first_x + (unit / 2) + (circle * unit);

                    if (circles == 7)
                        x+= unit / 2;

                    gr.Arc (x, (unit / 2) + first_y + (unit * line) - (unit / 8) * line,
                            (unit / 2), 0, 2 * Math.PI);
//.........这里部分代码省略.........
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:101,代码来源:PuzzleCirclesSquare.cs

示例8: Draw

        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");
            }
        }
开发者ID:GNOME,项目名称:gbrainy,代码行数:45,代码来源:PuzzleTrains.cs

示例9: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = DrawAreaX + 0.05, y = DrawAreaY + 0.1;
            double degrees, x1, x2, dist;

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

            for (int i = 0; i < random_indices_answers.Count; i++)
            {
                DrawFigure (gr, x, y, (Figures) random_indices_answers[i]);
                gr.MoveTo (x, y + 0.13);
                gr.ShowPangoText (Answer.GetFigureName (i));

                if (i  == (total_figures / 2) - 1) {
                    y+= 0.30;
                    x= DrawAreaX + 0.05;
                }
                else
                    x+= space_figures;
            }

            if (Answer.Draw == false)
                return;

            gr.MoveTo (DrawAreaX, y + 0.28);
            gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("The triangle is:"));
            gr.Stroke ();

            x = DrawAreaX + 0.35;
            y += 0.35;

            degrees = radian * 45;	// First triangle
            gr.MoveTo (x, y);
            x1 = x + figure_size * Math.Cos (degrees);
            gr.LineTo (x1, y + figure_size * Math.Sin (degrees));

            degrees = radian * (135);
            x2 = x + figure_size * Math.Cos (degrees);
            gr.MoveTo (x, y);
            gr.LineTo (x2, y + figure_size * Math.Sin (degrees));
            gr.LineTo (x1, y + figure_size * Math.Sin (degrees));
            dist = (x1 - x2);
            x += dist;

            degrees = radian * 45; // Second triangle
            gr.MoveTo (x, y);
            x1 = x + figure_size * Math.Cos (degrees);
            gr.LineTo (x1, y + figure_size * Math.Sin (degrees));

            degrees = radian * (135);
            x2 = x + figure_size * Math.Cos (degrees);
            gr.MoveTo (x, y);
            gr.LineTo (x2, y + figure_size * Math.Sin (degrees));
            gr.LineTo (x1, y + figure_size * Math.Sin (degrees));

            degrees = radian * (-45); // Bottom
            x =  DrawAreaX + 0.35;
            gr.MoveTo (x, y);
            gr.LineTo (x + figure_size * Math.Cos (degrees), y + figure_size * Math.Sin (degrees));

            x += dist;
            degrees = radian * (-135);
            gr.MoveTo (x, y);
            gr.LineTo (x + figure_size * Math.Cos (degrees), y + figure_size * Math.Sin (degrees));
            gr.Stroke ();
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:66,代码来源:PuzzleBuildTriangle.cs

示例10: DrawFigure

        public void DrawFigure(CairoContextEx gr, double x, double y, bool [] puzzle, int index)
        {
            double pos_x = x, pos_y = y;
            double square_size = figure_size / lines;
            double center_square = square_size / 2;
            double radius_square = (square_size - (LineWidth *2)) / 2.5;

            gr.Rectangle (pos_x, pos_y, figure_size, figure_size);
            gr.Stroke ();

            for (int line = 0; line < lines - 1; line++) // Horizontal
            {
                pos_y += square_size;
                gr.MoveTo (pos_x, pos_y);
                gr.LineTo (pos_x + figure_size, pos_y);
                gr.Stroke ();
            }

            pos_y = y;
            for (int column = 0; column < columns - 1; column++) // Vertical
            {
                pos_x += square_size;
                gr.MoveTo (pos_x, pos_y);
                gr.LineTo (pos_x, pos_y + figure_size);
                gr.Stroke ();
            }

            pos_y = y + center_square;
            pos_x = x + center_square;

            for (int line = 0; line < lines; line++) // Circles
            {
                for (int column = 0; column < columns; column++)
                {
                    if (puzzle[index + (columns * line) + column] == false)
                        continue;

                    gr.Arc (pos_x + (square_size * column), pos_y, radius_square, 0, 2 * Math.PI);
                    gr.Fill ();
                    gr.Stroke ();
                }
                pos_y += square_size;
            }
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:44,代码来源:PuzzleGridDots.cs

示例11: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            double x = DrawAreaX + 0.2, y = DrawAreaY;
            double x0, y0, degrees;
            int pos;

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

            gr.Arc (x + arc_centerx, y + arc_centery, radius, 0, 2 * Math.PI);
            gr.Stroke ();

            for (int slice = 0; slice < total_slices; slice++)
            {
                degrees = radian * slice * (360 / total_slices);
                gr.MoveTo (x + arc_centerx, y + arc_centery);
                gr.LineTo (x + arc_centerx + (radius * Math.Cos (degrees)), y + arc_centery + (radius * Math.Sin (degrees)));

                if (slice > total_slices - 1) continue;

                if (slice == 0) {
                    degrees = radian * (slice * ((360 / total_slices)) + (360 / 12));
                    x0 = 0.5 * radius * Math.Cos (degrees);
                    y0 = 0.5 * radius * Math.Sin (degrees);
                    gr.DrawTextCentered (x + arc_centerx + x0, y + arc_centery + y0, "?");
                    continue;
                }

                if (slice < half_slices) {
                    pos = random_indices [slice];
                    DrawSliceText (gr, x + arc_centerx, y + arc_centery, slice, (sum_offset + slices [pos * items_per_slice]).ToString (),
                         (sum_offset + slices [1 + (pos * items_per_slice)]).ToString (), (sum_offset + slices [2 + (pos * items_per_slice)]).ToString ());
                }
                else {
                    pos = random_indices [slice - half_slices];
                    DrawSliceText (gr, x + arc_centerx, y + arc_centery, slice, slices_opposite [pos * items_per_slice].ToString (),
                         slices_opposite [2 + (pos * items_per_slice)].ToString (), slices_opposite [1 + (pos * items_per_slice)].ToString ());
                }
            }

            gr.MoveTo (0.1, 0.55);
            gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Choose one of the following:"));
            gr.Stroke ();
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:43,代码来源:PuzzleMissingSlice.cs

示例12: DrawBar

        static void DrawBar(CairoContextEx gr, double x, double y, double w, double h, double percentage)
        {
            double per = percentage / 100;

            gr.Rectangle (x, y - h * per, w, h * per);
            gr.FillGradient (x, y - h * per, w, h * per, new Cairo.Color (0, 0, 1));
            gr.DrawTextCentered (x + w / 2, (y - 0.03) - h * per, String.Format ("{0}", percentage));

            gr.Save ();
            gr.Color = new Cairo.Color (0, 0, 0);
            gr.MoveTo (x, y);
            gr.LineTo (x, y - h * per);
            gr.LineTo (x + w, y - h * per);
            gr.LineTo (x + w, y);
            gr.LineTo (x, y);
            gr.Stroke ();
            gr.Restore ();
        }
开发者ID:GNOME,项目名称:gbrainy,代码行数:18,代码来源:FinishView.cs

示例13: Draw

        public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
        {
            const double size = 0.05;
            const double radian = Math.PI / 180;
            const int degrees = -45;
            const double radius = 0.035;
            const double size_y = 0.025;

            double x = DrawAreaX + 0.1;
            double y = DrawAreaY + 0.3;
            double x0, y0, offset_y;
            double offset_x = 0;

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

            x = 1 - (2 * DrawAreaX) - (columns * size * 1.5);
            x = DrawAreaX + x /2;

            // Front face
            for (int pos_y = 0; pos_y < rows; pos_y++)
            {
                //  |
                //  |
                //
                gr.MoveTo (x, y + (pos_y * size));
                gr.LineTo (x, y + ((pos_y + 1) * size));
                gr.Stroke ();

                for (int pos_x = 0; pos_x < columns; pos_x++)
                {
                    //  ---|
                    //     |
                    //
                    gr.MoveTo (x + (size * pos_x) , y + (pos_y * size));
                    gr.LineTo (x + (size * (pos_x + 1)), y + (pos_y * size));
                    gr.LineTo (x + (size * (pos_x + 1)), y + (pos_y + 1) * size);
                    gr.Stroke ();
                }
            }

            gr.MoveTo (x , y + (rows * size));
            gr.LineTo (x + (columns * size) , y + (rows * size));
            gr.Stroke ();

            // Back face
            for (int pos_y = 0; pos_y < rows; pos_y++)
            {
                offset_x = (0.025 * pos_y);

                //  |
                //  |
                //
                gr.MoveTo (x + offset_x, y - (pos_y * size_y));
                gr.LineTo (x + offset_x + 0.025, y - ((pos_y + 1)  * size_y));
                gr.Stroke ();

                for (int pos_x = 0; pos_x < columns; pos_x++)
                {
                    gr.MoveTo (x + offset_x + (size * pos_x) , y - (pos_y * size_y));
                    gr.LineTo (x + offset_x + (size * (pos_x + 1)), y - (pos_y * size_y));
                    gr.LineTo (x + offset_x +  0.025 + (size * (pos_x + 1)), y - (pos_y + 1) * size_y);
                    gr.Stroke ();
                }
            }

            offset_x = (0.025 * columns);
            gr.MoveTo (x + offset_x, y - (rows * size_y));
            gr.LineTo (x + offset_x + (size * columns) , y - (rows * size_y));
            gr.Stroke ();

            // Lateral face
            for (int pos_y = 0; pos_y < rows; pos_y++)
            {
                for (int pos_x = 0; pos_x < columns; pos_x++)
                {
                    offset_x = (size * columns) + (0.025 * pos_x);
                    offset_y = size_y * pos_x;

                    gr.MoveTo (x + offset_x, y - offset_y + (pos_y * size));
                    gr.LineTo (x + offset_x, y - offset_y + (pos_y + 1) * size);
                    x0 = radius * Math.Cos (degrees * radian);
                    y0 = radius * Math.Sin (degrees * radian);

                    gr.LineTo (x + offset_x + x0, y - offset_y + y0 +  (pos_y + 1) * size);
                    gr.Stroke ();
                }
            }

            offset_x = (size * columns) + (0.025 * columns);
            offset_y = size_y * rows;
            gr.MoveTo (x + offset_x, y - offset_y);
            gr.LineTo (x + offset_x, y - offset_y + (rows * size));
            gr.Stroke ();
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:94,代码来源:Puzzle3DCube.cs

示例14: DrawGrid

        void DrawGrid(CairoContextEx cr, double x, double y)
        {
            // Draw Axis
            cr.MoveTo (x, y);
            cr.LineTo (x, y + grid_height);
            cr.LineTo (x + grid_width, y + grid_height);
            cr.Stroke ();

            cr.Save ();
            cr.Color = axis_color;
            cr.LineWidth = 0.001;

            for (double line_y = y; line_y < grid_height + y; line_y += grid_height / 10) {
                cr.MoveTo (x, line_y);
                cr.LineTo (x + grid_width, line_y);
                cr.Stroke ();
            }

            cr.Restore ();

            // Draw score scale
            int pos = 100;
            for (double line_y = y; line_y < grid_height + y; line_y += grid_height / 10) {
                cr.DrawTextAlignedRight (x- 0.01, line_y, String.Format ("{0}", pos));
                pos -= 10;
            }
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:27,代码来源:PlayerHistoryView.cs

示例15: DrawLegend

        void DrawLegend(CairoContextEx cr, double x, double y)
        {
            const double line_size = 0.05, offset_x = 0.01, second_row = 0.05, space_hor = 0.35;
            double old_width;

            old_width = cr.LineWidth;
            cr.LineWidth = 0.01;

            cr.Color = total_color;
            cr.MoveTo (x, y);
            cr.LineTo (x + line_size, y);
            cr.Stroke ();
            cr.Color = text_color;
            cr.MoveTo (x + line_size + offset_x, y - 0.01);
            cr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Total"));
            cr.Stroke ();

            cr.Color = logic_color;
            cr.MoveTo (x, y + second_row);
            cr.LineTo (x + line_size, y + second_row);
            cr.Stroke ();
            cr.Color = text_color;
            cr.MoveTo (x + line_size + offset_x, y - 0.01 + second_row);
            cr.ShowPangoText (GameTypesDescription.GetLocalized (GameTypes.LogicPuzzle));
            cr.Stroke ();

            x += space_hor;
            cr.Color = memory_color;
            cr.MoveTo (x, y);
            cr.LineTo (x + line_size, y);
            cr.Stroke ();
            cr.Color = text_color;
            cr.MoveTo (x + line_size + offset_x, y - 0.01);
            cr.ShowPangoText (GameTypesDescription.GetLocalized (GameTypes.Memory));
            cr.Stroke ();

            cr.Color = math_color;
            cr.MoveTo (x, y + second_row);
            cr.LineTo (x + line_size, y + second_row);
            cr.Stroke ();
            cr.Color = text_color;
            cr.MoveTo (x + line_size + offset_x, y - 0.01 + second_row);
            cr.ShowPangoText (GameTypesDescription.GetLocalized (GameTypes.Calculation));
            cr.Stroke ();

            x += space_hor;
            cr.Color = verbal_color;
            cr.MoveTo (x, y);
            cr.LineTo (x + line_size, y);
            cr.Stroke ();
            cr.Color = text_color;
            cr.MoveTo (x + line_size + offset_x, y - 0.01);
            cr.ShowPangoText (GameTypesDescription.GetLocalized (GameTypes.VerbalAnalogy));
            cr.Stroke ();

            cr.LineWidth = old_width;
        }
开发者ID:syoubin,项目名称:gbrainy_android,代码行数:57,代码来源:PlayerHistoryView.cs


注:本文中的gbrainy.Core.Main.CairoContextEx.LineTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。