How to use the tcod.console_flush function in tcod

To help you get started, we’ve selected a few tcod examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eyeCube / Softly-Roguelike / src / rogue.py View on Github external
def refresh():  # final to root and flush
    libtcod.console_blit(con_final(), 0,0,window_w(),window_h(),  0, 0,0)
    libtcod.console_flush()
#@debug.printr
github Wolfenswan / RoguelikeTut-TCOD / rendering / draw_windows.py View on Github external
def draw_window(window, caption, window_x, window_y, width, height, show_cancel_option):
    draw_console_borders(window, color=colors.white)
    tcod.console_print(window, 2, 0, caption)

    if show_cancel_option:
        #tcod.console_print(window, 0, height - 1, '')
        string = ''
        x = center_x_for_text(width, '')
        tcod.console_print(window, x, height - 1, string)

    tcod.console_blit(window, 0, 0, width, height, 0, window_x, window_y, 1, 1)

    tcod.console_flush()
github Wolfenswan / RoguelikeTut-TCOD / gui / manual.py View on Github external
print_string(window,width - 12, 0, f'Page {pagecount}')
    print_string(window, 1, height - 1, '')
    print_string(window, width - 15, height - 1, '')

    offset_y = 2
    for p, paragraph in enumerate(page):
        print_string(window, 1, p + offset_y, paragraph)
        #window.draw_str( fg=colors.white, bg=None)
        # lines_wrapped = textwrap.wrap(paragraph, (width-padding_x//2))
        # for l, line in enumerate(lines_wrapped):
        # window.draw_str(1,p + offset_y, line, fg=colors.white, bg=None)
        # offset_y += 1

    tcod.console_blit(window, 0, 0, width, height, 0, x, y, 1, 1)
    tcod.console_flush()

    return window
github Wolfenswan / RoguelikeTut-TCOD / rendering / render_animations.py View on Github external
def render_animation(game:Game, anim_delay:float):
    render_map_screen(game, game.fov_map, debug=game.debug['reveal_map'])
    tcod.console_flush()
    time.sleep(anim_delay)
github clamytoe / roguelike / roguelike / app.py View on Github external
game_map,
            fov_map,
            fov_recompute,
            message_log,
            constants["screen_width"],
            constants["screen_height"],
            constants["bar_width"],
            constants["panel_height"],
            constants["panel_y"],
            mouse,
            constants["colors"],
            game_state,
        )

        fov_recompute = False
        tcod.console_flush()
        clear_all(con, entities)

        action = handle_keys(key, game_state)
        mouse_action = handle_mouse(mouse)

        move = action.get("move")
        wait = action.get("wait")
        pickup = action.get("pickup")
        show_inventory = action.get("show_inventory")
        drop_inventory = action.get("drop_inventory")
        inventory_index = action.get("inventory_index")
        take_stairs = action.get("take_stairs")
        level_up = action.get("level_up")
        show_character_screen = action.get("show_character_screen")
        exit_game = action.get("exit")
        full_screen = action.get("full_screen")
github Wolfenswan / RoguelikeTut-TCOD / rendering / render_main.py View on Github external
def render_all(game, fov_map, debug=False):

    render_map_screen(game, fov_map, debug=debug)
    render_panels(game)

    if game.state == GameState.CURSOR_ACTIVE:
        render_description_window(game)  # Description window is drawn under the cursor if active

    tcod.console_flush()
github libtcod / python-tcod / examples / samples_libtcodpy.py View on Github external
else :
            libtcod.sys_save_screenshot()
            print ("png")
    elif key.vk == libtcod.KEY_ESCAPE:
        break
    elif key.vk == libtcod.KEY_F1:
        libtcod.sys_set_renderer(libtcod.RENDERER_GLSL)
    elif key.vk == libtcod.KEY_F2:
        libtcod.sys_set_renderer(libtcod.RENDERER_OPENGL)
    elif key.vk == libtcod.KEY_F3:
        libtcod.sys_set_renderer(libtcod.RENDERER_SDL)
    elif key.vk == libtcod.KEY_F4:
        libtcod.sys_set_renderer(libtcod.RENDERER_SDL2)
    elif key.vk == libtcod.KEY_F5:
        libtcod.sys_set_renderer(libtcod.RENDERER_OPENGL2)
    libtcod.console_flush()
github JnyJny / hackstar / hackstar / engine.py View on Github external
def flush(self) -> None:
        """Push drawn state to screen.
        """
        tcod.console_flush()