We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to do a simple screenshot test. No bug but nothing happens. Do I need to initialized differently to get it to work?
import tdl def handle_keys(user_input): # Movement keys if user_input.key == 'UP': return {'move': (0, -1)} elif user_input.key == 'DOWN': return {'move': (0, 1)} elif user_input.key == 'LEFT': return {'move': (-1, 0)} elif user_input.key == 'RIGHT': return {'move': (1, 0)} if user_input.key == 'ENTER' and user_input.alt: # Alt+Enter: toggle full screen return {'fullscreen': True} elif user_input.key == 'ESCAPE': # Exit the game return {'exit': True} # No key was pressed return {} def main(): screen_width = 80 screen_height = 50 player_x = int(screen_width / 2) player_y = int(screen_height / 2) tdl.set_font('arial10x10.png', greyscale=True, altLayout=True) root_console = tdl.init(screen_width, screen_height, title='Roguelike Tutorial Revised', fullscreen=True) while not tdl.event.is_window_closed(): root_console.draw_char(player_x, player_y, '@', bg=None, fg=(255, 255, 255)) tdl.flush() root_console.draw_char(player_x, player_y, ' ', bg=None) for event in tdl.event.get(): if event.type == 'KEYDOWN': user_input = event break else: user_input = None if not user_input: continue action = handle_keys(user_input) move = action.get('move') exit = action.get('exit') fullscreen = action.get('fullscreen') if move: tdl.screenshot() ############################### dx, dy = move player_x += dx player_y += dy if exit: return True if fullscreen: tdl.set_fullscreen(not tdl.get_fullscreen()) return True if __name__ == "__main__": main()
The text was updated successfully, but these errors were encountered:
I can confirm the bug exists in libtcod itself. The screenshot code is non-trivial, so it will take a little while to fix.
The bug seems to be limited to the SDL renderer, so if you add renderer='GLSL' to tdl.init you should able to take screenshots.
renderer='GLSL'
tdl.init
Sorry, something went wrong.
Thanks, Kyle. Confirmed that setting the renderer works like a charm. Appreciate the quick response! Have a good rest of your weekend...
The regression in the old SDL renderer is fixed. You can now take screenshots with it active.
HexDecimal
No branches or pull requests
Trying to do a simple screenshot test. No bug but nothing happens. Do I need to initialized differently to get it to work?
The text was updated successfully, but these errors were encountered: