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.DrawTextCentered (0.5, DrawAreaY + 0.3, formula); }
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl) { base.Draw (gr, area_width, area_height, rtl); gr.DrawClock (DrawAreaX + 0.15, DrawAreaY + 0.1, figure_size,0, 0 /* No hands */); gr.SetPangoLargeFontSize (); gr.DrawTextCentered (0.5, DrawAreaY + 0.2 + figure_size, Translations.GetString ("Sample clock")); }
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:")); }
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:")); }
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)); }
public override void DrawObjectToMemorize(CairoContextEx gr, int area_width, int area_height, bool rtl) { StringBuilder sequence = new StringBuilder (64); base.DrawObjectToMemorize (gr, area_width, area_height, rtl); gr.SetPangoLargeFontSize (); for (int num = 0; num < Challenge.Numbers.Length - 1; num++) { sequence.Append (Challenge.Numbers [num]); sequence.Append (", "); } sequence.Append (Challenge.Numbers [Challenge.Numbers.Length - 1]); gr.DrawTextCentered (0.5, DrawAreaY + 0.3, sequence.ToString ()); }
public void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl) { gr.Scale (area_width, area_height); gr.LineWidth = 0.01; gr.Color = new Cairo.Color (0, 0, 0, 1); gr.SetPangoLargeFontSize (); gr.DrawTextCentered (0.5, 0.1, ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Get ready to memorize the next objects...")); gr.Stroke (); gr.SetPangoFontSize (0.35); gr.DrawTextCentered (0.5, 0.5, countdown_time.ToString ()); gr.Stroke (); gr.Arc (0.5, 0.5, 0.25, 0, 2 * Math.PI); gr.Stroke (); gr.Arc (0.5, 0.5, 0.28, 0, 2 * Math.PI); gr.Stroke (); }
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); } }
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 () : "?"); }
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")); }
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl) { StringBuilder sequence = new StringBuilder (64); base.Draw (gr, area_width, area_height, rtl); gr.SetPangoLargeFontSize (); for (int num = 0; num < max_num - 1; num++) { if (num == question) { sequence.Append ("?, "); } else { sequence.Append (numbers[num]); sequence.Append (", "); } } sequence.Append (numbers[max_num - 1]); gr.DrawTextCentered (0.5, DrawAreaY + 0.3, sequence.ToString ()); }
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl) { double x = DrawAreaX + 0.25; base.Draw (gr, area_width, area_height, rtl); gr.SetPangoLargeFontSize (); gr.MoveTo (x, DrawAreaY + 0.22); switch (type) { case SubGameTypes.Addition: gr.ShowPangoText (String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("x + y = {0}"), op1)); break; case SubGameTypes.Subtraction: gr.ShowPangoText (String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("x - y = {0}"), op1)); break; default: throw new InvalidOperationException (); } gr.MoveTo (x, DrawAreaY + 0.44); gr.ShowPangoText (String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("x * y = {0}"), op2)); }
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 ("number1 + number2 = {0}", op1)); gr.MoveTo (x, DrawAreaY + 0.44); gr.ShowPangoText (String.Format ("number1 * number2 = {0}", op2)); gr.Color = new Color (0.9, 0.9, 0.9); gr.DrawTextCentered (0.5, DrawAreaY, "This is an extension sample"); }
public override void DrawPossibleAnswers(CairoContextEx gr, int area_width, int area_height, bool rtl) { double x= DrawAreaX, y = DrawAreaY + 0.085; int pos = 0; gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, DefaultDrawingColor.B, 1); if (Answer.Draw == true) { DrawAllFigures (gr, start_x_ans, start_y); return; } gr.SetPangoNormalFontSize (); for (int i = 0; i < figures.Length; i++) { if (i == question_pos) continue; gr.MoveTo (x, y); gr.ShowPangoText (converter.ToString (figures[i])); if ((pos + 1) % 4 == 0) { y += 0.1; x = DrawAreaX; } else { x+= 0.25; } pos++; } base.DrawPossibleAnswers (gr, area_width, area_height, rtl); gr.SetPangoLargeFontSize (); gr.MoveTo (0, 0.4); gr.ShowPangoText (Translations.GetString ("Choose one of the following:")); gr.MoveTo (0, 0.08); gr.ShowPangoText (Translations.GetString ("List of images shown before")); }
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; } }
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl) { int rows = 7, columns = 9; double rect_w = DrawAreaWidth / columns; double rect_h = DrawAreaHeight / rows; int first_column; string text; base.Draw (gr, area_width, area_height, rtl); gr.SetPangoLargeFontSize (); for (int row = 0; row < rows; row++) { for (int column = 0; column < columns; column++) { gr.Rectangle (DrawAreaX + column * rect_w, DrawAreaY + row * rect_h, rect_w, rect_h); gr.Stroke (); if (row >= lines.Length) continue; first_column = (columns - lines[row].TotalNumbers) / 2; if (column < first_column || column - first_column >= lines [row].TotalNumbers) continue; if (row + 1 == lines.Length && lines [row].IsMiddle (column - first_column)) text = "?"; else text = lines [row].GetNumber (column - first_column).ToString (); gr.DrawTextCentered (DrawAreaX + (column * rect_w) + rect_w / 2, DrawAreaY + (row * rect_h) + rect_h / 2, text.ToString()); } } }
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl) { const double SEPARATION = 0.05; double x = DrawAreaX, y = 0.05; base.Draw (gr, area_width, area_height, rtl); gr.SetPangoLargeFontSize (); gr.MoveTo (0.05, y); gr.SetPangoLargeFontSize (); gr.ShowPangoText (Translations.GetString ("Numbers")); y += 0.08; x = ((1 - (DrawAreaX * 2) - SEPARATION * numbers.Length) / 2) + DrawAreaX; for (int n = 0; n < numbers.Length; n++) { gr.MoveTo (x, y); gr.ShowPangoText (numbers[n].ToString ()); gr.Stroke (); x += SEPARATION; } gr.MoveTo (0.1, 0.25); gr.ShowPangoText (Translations.GetString ("Choose one of the following:")); }