static void Main(string[] args) { double a = 0.1; GraphicsWindow.MouseDown += () => { GraphicsWindow.Clear(); int s = 20; int x = s; int y = s; int w = GraphicsWindow.Width - 2 * x - 10; int h = GraphicsWindow.Height - 2 * x - 10; DrawSquare(100, a, x, y, x + w, y, x + w, y + h, x, y + h); if (GraphicsWindow.LastKey == "D1") { a += 0.05; } if (GraphicsWindow.LastKey == "D2") { a -= 0.05; } }; }
static void Paint(int StartPosX, int StartPosY, int Scale) { GraphicsWindow.Clear(); for (int i = 0; i < bitPicture.GetLength(0); i++) { for (int j = 0; j < bitPicture.GetLength(1); j++) { if (bitPicture[i, j] == -1) { GraphicsWindow.BrushColor = "Red"; } else if (bitPicture[i, j] == 2) { GraphicsWindow.BrushColor = "Blue"; } else if (bitPicture[i, j] == 0) { GraphicsWindow.BrushColor = "White"; } GraphicsWindow.FillRectangle( x: StartPosX + (j - Scale / 2) * Scale, y: StartPosY + (i - Scale / 2) * Scale, width: Scale, height: Scale); } } }
/// <summary> /// Clears the current window and associated UI dictionaries /// </summary> static void ClearWindow() { int StackPointer = Stack.Add("UI.ClearWindow()"); GraphicsWindow.Clear(); _Buttons.Clear(); _TextBox.Clear(); Stack.Exit(StackPointer); }
private static void ResetTurtle() { GraphicsWindow.Clear(); GraphicsWindow.BackgroundColor = "White"; Turtle.Angle = 0; Turtle.X = 320; Turtle.Y = 240; Turtle.Show(); Turtle.PenDown(); UpdatePositionVariables(); turtleIsHidden = false; }
public static void Closing() { int StackPointer = Stack.Add("Events.Closing()"); if (string.IsNullOrEmpty(Engines.CurrentDatabase)) { LogMessage("Program Closing", Language.Localization["Application"]); //Localize } else { LogMessage("Program Closing - Closing : " + Engines.DatabaseShortname, Language.Localization["Application"]); //Localize } GraphicsWindow.Clear(); GraphicsWindow.Hide(); Stack.Exit(StackPointer); Environment.Exit(0); }
public static void Main(string[] args) { Pretty_turtle turtle = new Pretty_turtle(9); //Speed turtle.turtle_climbs_on_a_fence(5, 15); GraphicsWindow.Clear(); turtle.turtle_draws_a_regular_polygon(7, 30); GraphicsWindow.Clear(); turtle.turtle_draws_TEST(); GraphicsWindow.Clear(); turtle.turtle_goes_downstairs(5, 20); GraphicsWindow.Clear(); turtle.turtle_goes_upstairs(5, 20); GraphicsWindow.Clear(); Environment.Exit(0); }
private void buttonClear_Click(object sender, EventArgs e) { GraphicsWindow.Clear(); TextWindow.Clear(); }