skip to navigation
skip to content

tdl 3.1.0

Pythonic cffi port of libtcod.

Package Documentation


The recommended way to install is by using pip, make sure pip is up-to-date, old versions of pip may have issues installing libtcod-cffi.

To install using pip, use the following command:

python -m pip install tdl

Wheels are missing for PyPy on Mac OS X and Linux, so you’ll have to meet the additional dependencies of libtcod-cffi before running pip.


TDL is a port of the C library libtcod in an attempt to make it more “Pythonic”

The library can be used for displaying tilesets (ANSI, Unicode, or graphical) in true color.

It also provides functionality to compute path-finding and field of view.

python-tdl is hosted on GitHub:

Online Documentation:

Issue Tracker:

python-tdl is a cffi port of “libtcod”. You can find more about libtcod at


  • Python 2.7+, 3.3+, or PyPy
  • Windows, Linux, or Mac OS X
  • libtcod-cffi (automatically installed with pip)


python-tdl is distributed under the Simplified 2-clause FreeBSD license. Read LICENSE.txt for more details.


3.1.0 - 2017-05-28

  • You can now pass tdl Console instances as parameters to libtcod-cffi functions expecting a tcod Console.
  • Dependencies updated: libtcod-cffi>=2.5.0,<3
  • The Console.tcod_console attribute is being renamed to Console.console_c.
  • The tdl.noise and modules will be deprecated in the future.
  • Resolved crash-on-exit issues for Windows platforms.

3.0.2 - 2017-04-13

  • Dependencies updated: libtcod-cffi>=2.4.3,<3
  • You can now create Console instances before a call to tdl.init.
  • Dropped support for Python 3.3
  • Resolved issues with MacOS builds.
  • ‘OpenGL’ and ‘GLSL’ renderers work again.

3.0.1 - 2017-03-22

  • KeyEvent’s with text now have all their modifier keys set to False.
  • Undefined behaviour in text events caused crashes on 32-bit builds.

3.0.0 - 2017-03-21

  • KeyEvent supports libtcod text and meta keys.
  • KeyEvent parameters have been moved.
  • This version requires libtcod-cffi>=2.3.0.
  • KeyEvent camel capped attribute names are deprecated.
  • Crashes with key-codes undefined by libtcod.
  • typedef issues with libtcod-cffi.

2.0.1 - 2017-02-22

  • tdl.init renderer was defaulted to OpenGL which is not supported in the current version of libtcod.

2.0.0 - 2017-02-15

  • Dependencies updated, tdl now requires libtcod-cffi 2.x.x
  • Some event behaviours have changed with SDL2, event keys might be different than what you expect.
  • Key repeat functions were removed from SDL2. set_key_repeat is now stubbed, and does nothing.

1.6.0 - 2016-11-18

  • Console.blit methods can now take fg_alpha and bg_alpha parameters.

1.5.3 - 2016-06-04

  • set_font no longer crashes when loading a file without the implied font size in its name

1.5.2 - 2016-03-11

  • fixed non-square Map instances

1.5.1 - 2015-12-20

  • fixed errors with Unicode and non-Unicode literals on Python 2
  • fixed attribute error in compute_fov

1.5.0 - 2015-07-13

  • python-tdl distributions are now universal builds
  • new Map class
  • map.bresenham now returns a list
  • this release will require libtcod-cffi v0.2.3 or later

1.4.0 - 2015-06-22

  • The DLL’s have been moved into another library which you can find at You can use this library to have some raw access to libtcod if you want. Plus it can be used alongside TDL.
  • The libtocd console objects in Console instances have been made public.
  • Added tdl.event.wait function. This function can called with a timeout and can automatically call tdl.flush.

1.3.1 - 2015-06-19

  • Fixed pathfinding regressions.

1.3.0 - 2015-06-19

  • Updated backend to use python-cffi instead of ctypes. This gives decent boost to speed in CPython and a drastic to boost in speed in PyPy.

1.2.0 - 2015-06-06

  • The set_colors method now changes the default colors used by the draw_* methods. You can use Python’s Ellipsis to explicitly select default colors this way.
  • Functions and Methods renamed to match Python’s style-guide PEP 8, the old function names still exist and are depreciated.
  • The fgcolor and bgcolor parameters have been shortened to fg and bg
  • Noise generator now seeds properly
  • The OS event queue will now be handled during a call to tdl.flush. This prevents a common newbie programmer hang where events are handled infrequently during long animations, simulations, or early development
  • Fixed a major bug that would cause a crash in later versions of Python 3
  • Fixed a race condition when importing on some platforms
  • Fixed a type issue with quickFOV on Linux
  • Added a bresenham function to the module
  • a for loop can iterate over all coordinates of a Console
  • drawStr can be configured to scroll or raise an error
  • You can now configure or disable key repeating with tdl.event.setKeyRepeat
  • Typewriter class removed, use a Window instance for the same functionality
  • setColors method fixed
  • Merged the Typewriter and MetaConsole classes, You now have a virtual cursor with Console and Window objects
  • Fixed the clear method on the Window class
  • Fixed screenshot function
  • Fixed some drawing operations with unchanging backgrounds
  • Instances of Console and Noise can be pickled and copied
  • Added KeyEvent.keychar
  • Fixed event.keyWait, and now converts window closed events into Alt+F4
  • Some of the setFont parameters were incorrectly labeled and documented
  • setFont can auto-detect tilesets if the font sizes are in the filenames
  • Added some X11 unicode tilesets, including unifont.
  • Window title now defaults to the running scripts filename
  • Fixed incorrect deltaTime for App.update
  • App will no longer call tdl.flush on its own, you’ll need to call this yourself
  • tdl.noise module added
  • clear method now defaults to black on black
  • map submodule added with AStar class and quickFOV function
  • new Typewriter class
  • most console functions can use Python-style negative indexes now
  • new App.runOnce method
  • rectangle geometry is less strict
  • KeyEvent.keyname is now KeyEvent.key
  • MouseButtonEvent.button now behaves like KeyEvent.keyname does
  • event.App class added
  • drawing methods no longer have a default for the character parameter
  • KeyEvent.ctrl is now KeyEvent.control
File Type Py Version Uploaded on Size
tdl-3.1.0-py2.py3-none-any.whl (md5) Python Wheel py2.py3 2017-05-29 39KB
tdl-3.1.0.tar.gz (md5) Source 2017-05-29 971KB