Exemplo n.º 1
0
                        speed = panel.speed_control()

                    if (panel.showH_btn.detect_click()):
                        g.showHeuristic = panel.showH_btn.detect_toggle()

                    if (panel.showC_btn.detect_click()):
                        g.showCost = panel.showC_btn.detect_toggle()

    canvas.fill((255, 255, 255))
    canvas.blit(draw_grid(hor, ver, grid_size), (0, 0))
    panel.fill()
    screen.fill(panelColor)
    pygame.draw.rect(screen, (0, 0, 0), (hor, 0, panelHor, ver), 10)

    panel.displayMessage(
        "Draw a Graph, then select an algorithm to run on the graph. nl > ADD Node [Left CLick]. nl > Remove Node [Right Click]. nl > Select Node [Left Click]"
    )

    g.draw_edges()
    g.draw_nodes(mouse)
    # g.input_depth_limit(mouse)
    # box = pygame.Rect(500, 300, 50, 50)#prompt_rect.width + 20, prompt_rect.height + 30)
    # pygame.draw.rect(canvas, (0,0,0), box)

    panel.draw_btns()
    panel.btnDetect_hover(mouse)

    #$ Update Display
    screen.blit(canvas, (0, 0))
    screen.blit(panel.panel_surf, (panel.cordX, panel.cordY))