public virtual void renderMouse() { int X = mouse.X(); int Y = mouse.Y(); display.setPixel(X, Y, 0); display.setPixel(X + 1, Y, 0); display.setPixel(X + 2, Y, 0); display.setPixel(X + 3, Y, 0); display.setPixel(X + 4, Y, 0); display.setPixel(X, Y + 1, 0); display.setPixel(X + 1, Y + 1, color); display.setPixel(X + 2, Y + 1, color); display.setPixel(X + 3, Y + 1, 0); display.setPixel(X, Y + 2, 0); display.setPixel(X + 1, Y + 2, color); display.setPixel(X + 2, Y + 2, 0); display.setPixel(X, Y + 3, 0); display.setPixel(X + 1, Y + 3, 0); display.setPixel(X, Y + 4, 0); }
public static void handleMouse(MouseDriver mouse) { if (isVisible) { if (mouse.LeftClickState()) { if (held) { if (mouse.X() + width < 320) { x = mouse.X(); } else { x = 320 - width; } if (mouse.Y() + height < 200) { y = mouse.Y(); } else { y = 200 - height; } } else { if (mouse.X() > (x + width - 20) && mouse.X() < (x + width) && mouse.Y() > y && mouse.Y() < y + 20) { isVisible = false; } else { if (mouse.X() > x && mouse.X() < (x + width - 60) && mouse.Y() > y && mouse.Y() < y + 20) { held = true; } } } } else { held = false; } } }
public void handleMouse(MouseDriver mouse) { if (mouse.LeftClickState()) { if (held) { x = mouse.X(); y = mouse.Y(); } else { if (mouse.X() > x && mouse.X() < (x + width - 60) && mouse.Y() > y && mouse.Y() < y + 20) { held = true; } } } else { held = false; } }
public virtual void renderMouse() { int X = mouse.X(); int Y = mouse.Y(); display.setPixel(X, Y, 40); display.setPixel(X + 1, Y, 40); display.setPixel(X + 2, Y, 40); display.setPixel(X, Y + 1, 40); display.setPixel(X, Y + 2, 40); display.setPixel(X + 1, Y + 1, 40); display.setPixel(X + 2, Y + 2, 40); display.setPixel(X + 3, Y + 3, 40); }
/* protected override void Run() * { * Font f = new BasicFont(); * FontRenderer fr = new FontRenderer(display, f, 63); * FontRenderer dfr = new FontRenderer(display, f, 0); * * IconPack ip = new BasicIconPack(); * IconRenderer ir = new IconRenderer(display, ip); * * startMenu = false; * held = false; * * second = time.Second(); * while (true) * { * WindowManager.handleMouse(mouse); * handleMouse(mouse); * draw(fr, dfr, startMenu, ir); * WindowManager.drawWindows(display, ir, dfr); * mr.renderMouse(); * display.step(); * } */ public void handleMouse(MouseDriver mouse) { if (mouse.LeftClickState()) { if (held == false) { if (mouse.X() > 0 && mouse.X() < 120 && mouse.Y() > 0 && mouse.Y() < 15) { startMenu = !startMenu; } else if (startMenu && mouse.X() > 0 && mouse.X() < 120 && mouse.Y() > 15 && mouse.Y() < 155) { if (mouse.X() > 25 && mouse.X() < 110 && mouse.Y() > 80 && mouse.Y() < 95) { Sys.Power.Reboot(); } } else { if (mouse.X() > 85 && mouse.X() < 105 && mouse.Y() > 15 && mouse.Y() < 25) { NotepadWindow.reset(); } if (startMenu == true) { startMenu = false; } } held = true; } } else { held = false; } }