public void InputDraw() { _screen.Clear(Color.Gray); SplashKit.DrawRectangle(Color.Black, X, Y, Width, Height); SplashKit.FillRectangle(Color.LightGray, X + 1, Y + 1, Width - 2, Height - 2); SplashKit.DrawTextOnWindow(_screen, "Name: ", Color.Black, "Fira", 20, X + 10, Y + 10); SplashKit.FillRectangle(Color.White, X + 130, Y + 10, 400, 20); SplashKit.DrawTextOnWindow(_screen, "Assignments: ", Color.Black, "Fira", 20, X + 10, Y + 50); SplashKit.FillRectangle(Color.White, X + 130, Y + 50, 400, 20); SplashKit.FillRectangle(Color.DarkGray, X + 110, Y + 150, 80, 25); SplashKit.DrawTextOnWindow(_screen, "Next", Color.White, "Fira", 20, X + 130, Y + 150); if (_inp == 0) { SplashKit.DrawTextOnWindow(_screen, _name, Color.Black, "Fira", 19, X + 135, Y + 11); SplashKit.DrawTextOnWindow(_screen, Convert.ToString(_noOfAssignments), Color.Black, "Fira", 19, X + 135, Y + 51); } else if (_inp == 1) { SplashKit.DrawTextOnWindow(_screen, Convert.ToString(_noOfAssignments), Color.Black, "Fira", 19, X + 135, Y + 51); } else if (_inp == 2) { SplashKit.DrawTextOnWindow(_screen, _name, Color.Black, "Fira", 19, X + 135, Y + 11); } }
public void Show() { const int WIDTH = 200, HEIGHT = 100, GAP = 30; SplashKit.ProcessEvents(); while (!SplashKit.KeyTyped(KeyCode.EscapeKey)) { int i = 0, j = 0; SplashKit.ProcessEvents(); _screen.Clear(Color.Gray); SplashKit.FillRectangle(Color.LightGray, X, Y, Width, Height); foreach (DashboardData assignment in _collection) { int x = X + WIDTH * j + GAP, y = Y + HEIGHT * i + GAP; SplashKit.DrawRectangle(Color.Black, x, y, WIDTH, HEIGHT); SplashKit.FillRectangle(GetUgrencyColor(assignment), x + 1, y + 1, WIDTH - 2, HEIGHT - 2); SplashKit.DrawTextOnWindow(_screen, assignment.unitName, Color.Black, "Fira", 25, x + 5, y + 5); SplashKit.DrawTextOnWindow(_screen, assignment.assignmentName, Color.Black, "Fira", 20, x + 5, y + 30); SplashKit.DrawTextOnWindow(_screen, assignment.dueDate.Day.ToString() + "-" + assignment.dueDate.Month.ToString() + "-" + assignment.dueDate.Year.ToString(), Color.Black, "Fira", 20, x + 5, y + 50); SplashKit.DrawTextOnWindow(_screen, assignment.dueDate.Subtract(DateTime.Today).Days.ToString() + " days left", Color.Black, "Fira", 20, x + 5, y + 75); if (++i > 3) { j++; i = 0; } } _screen.Refresh(60); } }
public void Score() { uint score = SplashKit.TimerTicks(gameTime); string testS = score.ToString(); SplashKit.DrawTextOnWindow(_gameWindow, testS, Color.Black, 5, 0); }
public void Draw() { _GameWindow.Clear(Color.White); foreach (Robot robot in _Robot) { robot.Draw(); } for (int i = 1; i <= Lives; i++) { SplashKit.DrawBitmap(Life, 600 - (i * 50), 50); } SplashKit.DrawTextOnWindow(_GameWindow, Convert.ToString(_Score.Ticks / 1000), Color.Black, 50, 50); _Player.Draw(); _GameWindow.Refresh(60); }
public void HandleInput() { if (SplashKit.MouseClicked(MouseButton.LeftButton)) { Console.WriteLine(SplashKit.MousePosition().X); Console.WriteLine(SplashKit.MousePosition().Y); if (SplashKit.MousePosition().X > X + 130 && SplashKit.MousePosition().X < X + 530 && SplashKit.MousePosition().Y > Y + 10 && SplashKit.MousePosition().Y < Y + 30) { switch (_inp) { case 1: { _name = SplashKit.TextInput(); break; } case 2: { _weightage = Convert.ToInt32(SplashKit.TextInput()); break; } case 3: { _dueDate = Convert.ToDateTime(SplashKit.TextInput()); break; } } SplashKit.EndReadingText(); _inp = 1; SplashKit.StartReadingText(new Rectangle() { X = X + 130, Y = Y + 10, Width = 400, Height = 20 }); //SplashKit.DrawCollectedText(Color.Black,"Fira",20); } else if (SplashKit.MousePosition().X > X + 130 && SplashKit.MousePosition().X < X + 530 && SplashKit.MousePosition().Y > Y + 50 && SplashKit.MousePosition().Y < Y + 70) { switch (_inp) { case 1: { _name = SplashKit.TextInput(); break; } case 2: { _weightage = Convert.ToInt32(SplashKit.TextInput()); break; } case 3: { _dueDate = Convert.ToDateTime(SplashKit.TextInput()); break; } } _inp = 2; SplashKit.EndReadingText(); SplashKit.StartReadingText(new Rectangle() { X = X + 130, Y = Y + 50, Width = 400, Height = 20 }); } else if (SplashKit.MousePosition().X > X + 130 && SplashKit.MousePosition().X < X + 530 && SplashKit.MousePosition().Y > Y + 90 && SplashKit.MousePosition().Y < Y + 110) { switch (_inp) { case 1: { _name = SplashKit.TextInput(); break; } case 2: { _weightage = Convert.ToInt32(SplashKit.TextInput()); break; } case 3: { _dueDate = Convert.ToDateTime(SplashKit.TextInput()); break; } } _inp = 3; SplashKit.EndReadingText(); SplashKit.StartReadingText(new Rectangle() { X = X + 130, Y = Y + 90, Width = 400, Height = 20 }); } else if (SplashKit.MousePosition().X > X + 110 && SplashKit.MousePosition().X < X + 190 && SplashKit.MousePosition().Y > Y + 150 && SplashKit.MousePosition().Y < Y + 175) { switch (_inp) { case 1: { _name = SplashKit.TextInput(); break; } case 2: { _weightage = Convert.ToInt32(SplashKit.TextInput()); break; } case 3: { _dueDate = Convert.ToDateTime(SplashKit.TextInput()); break; } } _inp = 0; SplashKit.EndReadingText(); Console.WriteLine("Done!"); _hasExecuted = true; } else { Console.WriteLine(SplashKit.TextInput()); switch (_inp) { case 1: { _name = SplashKit.TextInput(); break; } case 2: { _weightage = Convert.ToInt32(SplashKit.TextInput()); break; } case 3: { _dueDate = Convert.ToDateTime(SplashKit.TextInput()); break; } } _inp = 0; SplashKit.EndReadingText(); } } if (SplashKit.ReadingText()) { //Console.WriteLine(SplashKit.TextInput()); switch (_inp) { case 1: { SplashKit.DrawTextOnWindow(_screen, SplashKit.TextInput(), Color.Black, "Fira", 19, X + 135, Y + 11); break; } case 2: { SplashKit.DrawTextOnWindow(_screen, SplashKit.TextInput(), Color.Black, "Fira", 19, X + 135, Y + 51); break; } case 3: { SplashKit.DrawTextOnWindow(_screen, SplashKit.TextInput(), Color.Black, "Fira", 19, X + 135, Y + 91); break; } } } if (SplashKit.KeyTyped(KeyCode.ReturnKey)) { Console.WriteLine(SplashKit.TextInput()); switch (_inp) { case 1: { _name = SplashKit.TextInput(); break; } case 2: { _weightage = Convert.ToInt32(SplashKit.TextInput()); break; } case 3: { _dueDate = Convert.ToDateTime(SplashKit.TextInput()); break; } } SplashKit.EndReadingText(); _inp = 0; } }