本文整理汇总了C#中gbrainy.Core.Main.CairoContextEx.ShowPangoText方法的典型用法代码示例。如果您正苦于以下问题:C# CairoContextEx.ShowPangoText方法的具体用法?C# CairoContextEx.ShowPangoText怎么用?C# CairoContextEx.ShowPangoText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gbrainy.Core.Main.CairoContextEx
的用法示例。
在下文中一共展示了CairoContextEx.ShowPangoText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawPossibleAnswers
public override void DrawPossibleAnswers(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x= DrawAreaX + 0.125, y = DrawAreaY + 0.1;
int cnt = 0;
for (int i = 0; i < showed; i++)
{
if (i == answer)
continue;
gr.MoveTo (x, y);
gr.ShowPangoText (animals[animals_order[i]]);
gr.Stroke ();
if ((cnt + 1) % 3 == 0) {
y += 0.2;
x = DrawAreaX + 0.125;
} else {
x+= 0.25;
}
cnt++;
}
gr.Color = new Color (0.9, 0.9, 0.9);
gr.DrawTextCentered (0.5, DrawAreaY, "This is an extension sample");
}
示例2: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.Draw (gr, area_width, area_height, rtl);
gr.SetPangoLargeFontSize ();
gr.MoveTo (0.1, DrawAreaY);
gr.ShowPangoText (Translations.GetString ("Choose one of the following:"));
}
示例3: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.Draw (gr, area_width, area_height, rtl);
gr.SetPangoLargeFontSize ();
gr.MoveTo (0.1, 0.15);
gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Choose one of the following:"));
}
示例4: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = DrawAreaX + 0.15;
base.Draw (gr, area_width, area_height, rtl);
for (int i = 0; i < 2; i++)
DrawFigureSequence (gr, x, DrawAreaY + sub_figure * i , i, true);
DrawFigureSequence (gr, x, DrawAreaY + sub_figure * 2 , 2, false);
gr.MoveTo (0.1, 0.62);
gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Choose one of the following:"));
}
示例5: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = DrawAreaX + 0.1;
base.Draw (gr, area_width, area_height, rtl);
gr.SetPangoLargeFontSize ();
gr.MoveTo (x, DrawAreaY + 0.22);
gr.ShowPangoText (String.Format (Translations.GetString ("x + y = {0}"), number_a + number_b));
gr.MoveTo (x, DrawAreaY + 0.44);
gr.ShowPangoText (String.Format (Translations.GetString ("have a ratio of {0}:{1}"), ratio_a, ratio_b));
}
示例6: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = DrawAreaX, y = DrawAreaY + 0.1;
base.Draw (gr, area_width, area_height, rtl);
for (int i = 0; i < 4; i++) {
DrawQuestionFigures (gr, x, y, random_indices_questions [i]);
x += space_figures;
}
gr.MoveTo (0.1, 0.4 - 0.02);
gr.ShowPangoText (Translations.GetString ("Choose one of the following:"));
}
示例7: DrawObjectToMemorize
public override void DrawObjectToMemorize(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.DrawObjectToMemorize (gr, area_width, area_height, rtl);
if (Answer.Draw == false) {
for (int i = 0; i < indications.Length; i++)
{
gr.MoveTo (0.3, 0.2 + i * 0.08);
gr.ShowPangoText (indications[i].ToString ());
gr.Stroke ();
}
} else {
for (int i = 0; i < indications.Length; i++)
{
gr.MoveTo (0.1, 0.2 + i * 0.08);
gr.ShowPangoText (indications[i].ToString ());
gr.Stroke ();
}
DrawPossibleAnswers (gr, 0.7, 0.3, WhichAnswer (answers[ans]));
gr.MoveTo (0.7, 0.5);
gr.ShowPangoText (Answer.GetFigureName (ans));
gr.Stroke ();
}
}
示例8: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = DrawAreaX, y = 0.05;
base.Draw (gr, area_width, area_height, rtl);
gr.MoveTo (0.05, y);
gr.SetPangoLargeFontSize ();
gr.ShowPangoText (Translations.GetString ("Numbers"));
y += 0.08;
for (int n = 0; n < numbers.Length; n++)
{
gr.MoveTo (x, y);
gr.ShowPangoText (numbers[n].ToString ());
gr.Stroke ();
x += 0.17;
}
y += 0.16;
gr.MoveTo (0.05, y);
gr.ShowPangoText (Translations.GetString ("Possible divisors"));
}
示例9: 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 () : "?");
}
示例10: DrawPossibleAnswers
public override void DrawPossibleAnswers(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x= DrawAreaX + 0.125, y = DrawAreaY + 0.1;
int cnt = 0;
for (int i = 0; i < showed; i++)
{
if (i == answer)
continue;
gr.MoveTo (x, y);
gr.ShowPangoText (words[words_order[i]]);
gr.Stroke ();
if ((cnt + 1) % 3 == 0) {
y += 0.2;
x = DrawAreaX + 0.125;
} else {
x+= 0.25;
}
cnt++;
}
}
示例11: 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);
//.........这里部分代码省略.........
示例12: 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 ();
}
示例13: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double operand_y = DrawAreaY + 0.2;
const double operand_space = 0.1;
const double aligned_pos = 0.58;
base.Draw (gr, area_width, area_height, rtl);
gr.SetPangoLargeFontSize ();
for (int i = 0; i < operands.Length - 1; i++)
{
gr.DrawTextAlignedRight (aligned_pos, operand_y, operands[i].ToString ());
gr.MoveTo (DrawAreaX + 0.2, operand_y + 0.03);
switch (operation) {
case Operation.Addition:
gr.ShowPangoText ("+");
break;
case Operation.Subtraction:
gr.ShowPangoText ("-");
break;
case Operation.Multiplication:
gr.ShowPangoText ("*");
break;
}
operand_y += operand_space;
}
gr.DrawTextAlignedRight (aligned_pos, operand_y, operands[operands.Length - 1].ToString ());
operand_y += 0.08;
gr.MoveTo (DrawAreaX + 0.2, operand_y);
gr.LineTo (DrawAreaX + 0.5, operand_y);
gr.Stroke ();
if (Answer.Draw) {
gr.DrawTextAlignedRight (aligned_pos, operand_y + 0.03, Answer.Correct);
}
}
示例14: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
int element;
double x = DrawAreaX;
double y = 0.05, pos_y;
base.Draw (gr, area_width, area_height, rtl);
for (int i = 0; i < (Answer.Draw ? question_columns : question_columns - 1); i++)
{
element = question_indices [i];
pos_y = y;
for (int n = 0; n < figures_column; n++)
{
DrawFigure (gr, x, pos_y, figures [(n * question_columns) + element]);
pos_y+= figure_size + space_height;
}
x+= figure_size + space_width;
}
if (Answer.Draw == false) {
gr.Save ();
gr.SetPangoFontSize (figure_size);
for (int n = 0; n < figures_column; n++) {
gr.MoveTo (x, y - 0.02);
gr.ShowPangoText ("?");
gr.Stroke ();
y+= figure_size + space_height;
}
gr.SetPangoNormalFontSize ();
gr.Restore ();
}
gr.MoveTo (0.08, 0.45);
gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Choose one of the following:"));
gr.Stroke ();
}
示例15: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = 0.05 + space_figures / 2, y = DrawAreaY;
base.Draw (gr, area_width, area_height, rtl);
DrawFigure (gr, x, y, puzzle, 0);
DrawFigure (gr, x + figure_size + space_figures, y, puzzle, columns * lines);
DrawFigure (gr, x + (figure_size + space_figures) * 2, y, puzzle, columns * lines * 2);
y += figure_size + 0.10;
gr.MoveTo (x, y - 0.02);
gr.ShowPangoText (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Choose one of the following:"));
}