Skip to main content

Pythonic cffi port of libtcod.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Status

VersionsBadge ImplementationBadge LicenseBadge

PyPI Documentation Status Appveyor Travis Coveralls Codecov Codacy Scrutinizer Code Health

Requirements Status Pyup

About

This is a Python cffi port of libtcod.

This library is hosted on GitHub.

Any issues you have with this module can be reported at the GitHub issue tracker.

Usage

This module was designed to be backward compatible with the original libtcodpy module distributed with libtcod. If you had code that runs on libtcodpy then you can use this library as a drop-in replacement:

import tcod as libtcod

Guides and Tutorials for libtcodpy should work with the tcod module.

The latest documentation can be found here.

Installation

The recommended way to install is by using pip. Older versions of pip will have issues installing tdl, so make sure it’s up-to-date.

Windows / MacOS

To install using pip, use the following command:

> python -m pip install tdl

If you get the error “ImportError: DLL load failed: The specified module could not be found.” when trying to import tcod/tdl then you may need the latest Microsoft Visual C runtime.

Linux

The easiest method to install tdl on Linux would be from the PPA, this method will work for the Zesty, Artful, and Bionic versions of Ubuntu:

$ sudo add-apt-repository ppa:4b796c65/ppa
$ sudo apt-get update
$ sudo apt-get install python-tdl python3-tdl

Otherwise tdl will need to be built from source. Assuming you have Python, pip, and apt-get, then you’ll run these commands to install tdl and its dependencies to your user environment:

$ sudo apt-get install gcc python-dev python3-dev libsdl2-dev libffi-dev
$ pip2 install tdl
$ pip3 install tdl

Requirements

  • Python 2.7+, Python 3.4+, or PyPy 5.4+

  • Windows, Linux, or MacOS.

  • On Linux, requires libsdl2 to run.

License

python-tdl is distributed under the Simplified 2-clause FreeBSD license.

Changelog

Changes relevant for users of the the tdl and tcod packages are documented here.

This project adheres to Semantic Versioning since v2.0.0

4.2.3 - 2018-01-06

Fixed
  • Fixed setup.py regression that could prevent building outside of the git repository.

4.2.2 - 2018-01-06

Fixed
  • The Windows dynamic linker will now prefer the bundled version of SDL. This fixes: “ImportError: DLL load failed: The specified procedure could not be found.”

  • key.c is no longer set when key.vk == KEY_TEXT, this fixes a regression which was causing events to be heard twice in the libtcod/Python tutorial.

4.2.0 - 2018-01-02

Changed
  • Updated libtcod backend to v1.6.4

  • Updated SDL to v2.0.7 for Windows/MacOS.

Removed
Fixed
  • Fixed “final link failed: Nonrepresentable section on output” error when compiling for Linux.

  • tcod.console_init_root defaults to the SDL renderer, other renderers cause issues with mouse movement events.

4.1.1 - 2017-11-02

Fixed
  • Fixed ConsoleBuffer.blit regression.

  • Console defaults corrected, the root console’s blend mode and alignment is the default value for newly made Console’s.

  • You can give a byte string as a filename to load parsers.

4.1.0 - 2017-07-19

Added
  • tdl Map class can now be pickled.

Changed
  • Added protection to the transparent, walkable, and fov attributes in tcod and tdl Map classes, to prevent them from being accidentally overridden.

  • tcod and tdl Map classes now use numpy arrays as their attributes.

4.0.1 - 2017-07-12

Fixed
  • tdl: Fixed NameError in set_fps.

4.0.0 - 2017-07-08

Changed
  • tcod.bsp: BSP.split_recursive parameter random is now seed.

  • tcod.console: Console.blit parameters have been rearranged. Most of the parameters are now optional.

  • tcod.noise: Noise.__init__ parameter rand is now named seed.

  • tdl: Changed set_fps paramter name to fps.

Fixed
  • tcod.bsp: Corrected spelling of max_vertical_ratio.

3.2.0 - 2017-07-04

Changed
  • Merged libtcod-cffi dependency with TDL.

Fixed
  • Fixed boolean related crashes with Key ‘text’ events.

  • tdl.noise: Fixed crash when given a negative seed. As well as cases where an instance could lose its seed being pickled.

3.1.0 - 2017-05-28

Added
  • You can now pass tdl Console instances as parameters to libtcod-cffi functions expecting a tcod Console.

Changed
  • Dependencies updated: libtcod-cffi>=2.5.0,<3

  • The Console.tcod_console attribute is being renamed to Console.console_c.

Deprecated
  • The tdl.noise and tdl.map modules will be deprecated in the future.

Fixed
  • Resolved crash-on-exit issues for Windows platforms.

3.0.2 - 2017-04-13

Changed
  • Dependencies updated: libtcod-cffi>=2.4.3,<3

  • You can now create Console instances before a call to tdl.init.

Removed
  • Dropped support for Python 3.3

Fixed
  • Resolved issues with MacOS builds.

  • ‘OpenGL’ and ‘GLSL’ renderers work again.

3.0.1 - 2017-03-22

Changed
  • KeyEvent’s with text now have all their modifier keys set to False.

Fixed
  • Undefined behaviour in text events caused crashes on 32-bit builds.

3.0.0 - 2017-03-21

Added
  • KeyEvent supports libtcod text and meta keys.

Changed
  • KeyEvent parameters have been moved.

  • This version requires libtcod-cffi>=2.3.0.

Deprecated
  • KeyEvent camel capped attribute names are deprecated.

Fixed
  • Crashes with key-codes undefined by libtcod.

  • tdl.map typedef issues with libtcod-cffi.

2.0.1 - 2017-02-22

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

2.0.0 - 2017-02-15

Changed
  • 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.

Removed
  • 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 https://github.com/HexDecimal/libtcod-cffi 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.

1.1.7 - 2015-03-19

  • 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

1.1.6 - 2014-06-27

  • Fixed a race condition when importing on some platforms.

  • Fixed a type issue with quickFOV on Linux.

  • Added a bresenham function to the tdl.map module.

1.1.5 - 2013-11-10

  • 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.

1.1.4 - 2013-03-06

  • 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.

1.1.3 - 2012-12-17

  • 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.

1.1.2 - 2012-12-13

  • 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.

1.1.1 - 2012-12-05

  • 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.

1.1.0 - 2012-10-04

  • 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

1.0.8 - 2010-04-07

  • No longer works in Python 2.5 but now works in 3.x and has been partly tested.

  • Many bug fixes.

1.0.5 - 2010-04-06

  • Got rid of setuptools dependency, this will make it much more compatible with Python 3.x

  • Fixed a typo with the MacOS library import.

1.0.4 - 2010-04-06

  • All constant colors (C_*) have been removed, they may be put back in later.

  • Made some type assertion failures show the value they received to help in general debugging. Still working on it.

  • Added MacOS and 64-bit Linux support.

1.0.0 - 2009-01-31

  • First public release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tdl-4.2.3.tar.gz (451.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tdl-4.2.3-pp259-pypy_41-win32.whl (711.2 kB view details)

Uploaded PyPyWindows x86

tdl-4.2.3-pp259-pypy_41-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded PyPymacOS 10.12+ x86-64

tdl-4.2.3-pp258-pypy_41-win32.whl (711.1 kB view details)

Uploaded PyPyWindows x86

tdl-4.2.3-pp258-pypy_41-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded PyPymacOS 10.12+ x86-64

tdl-4.2.3-pp257-pypy_41-win32.whl (711.1 kB view details)

Uploaded PyPyWindows x86

tdl-4.2.3-pp257-pypy_41-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded PyPymacOS 10.12+ x86-64

tdl-4.2.3-cp36-cp36m-win_amd64.whl (953.8 kB view details)

Uploaded CPython 3.6mWindows x86-64

tdl-4.2.3-cp36-cp36m-win32.whl (787.6 kB view details)

Uploaded CPython 3.6mWindows x86

tdl-4.2.3-cp35-cp35m-win_amd64.whl (953.8 kB view details)

Uploaded CPython 3.5mWindows x86-64

tdl-4.2.3-cp35-cp35m-win32.whl (787.6 kB view details)

Uploaded CPython 3.5mWindows x86

tdl-4.2.3-cp34-cp34m-win_amd64.whl (954.7 kB view details)

Uploaded CPython 3.4mWindows x86-64

tdl-4.2.3-cp34-cp34m-win32.whl (791.6 kB view details)

Uploaded CPython 3.4mWindows x86

tdl-4.2.3-cp34-abi3-macosx_10_6_intel.whl (2.0 MB view details)

Uploaded CPython 3.4+macOS 10.6+ Intel (x86-64, i386)

tdl-4.2.3-cp27-cp27m-win_amd64.whl (956.1 kB view details)

Uploaded CPython 2.7mWindows x86-64

tdl-4.2.3-cp27-cp27m-win32.whl (785.6 kB view details)

Uploaded CPython 2.7mWindows x86

tdl-4.2.3-cp27-cp27m-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 2.7mmacOS 10.12+ x86-64

tdl-4.2.3-cp27-cp27m-macosx_10_6_intel.whl (2.0 MB view details)

Uploaded CPython 2.7mmacOS 10.6+ Intel (x86-64, i386)

File details

Details for the file tdl-4.2.3.tar.gz.

File metadata

  • Download URL: tdl-4.2.3.tar.gz
  • Upload date:
  • Size: 451.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tdl-4.2.3.tar.gz
Algorithm Hash digest
SHA256 13458baba3b1242f5993a3fd16ecb661fae03f4460021daa36ba3f3f84efc59e
MD5 0da91e342e2a748d4570d6a84b1d5493
BLAKE2b-256 fb0146c5ac00946aeb89a36214c8db402ce48aaaf38eb1a366bc2b81b28a85e9

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-pp259-pypy_41-win32.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-pp259-pypy_41-win32.whl
Algorithm Hash digest
SHA256 18160392a89010a17a9e81030c228fcdab064e79566e56d463f6bd5ae641d286
MD5 e49f38e02a85208a1f7bafbca8f58406
BLAKE2b-256 63f64121a6a9491c203f5cd35b1c3e5b7bdf106370290e75064fe716203fcfe5

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-pp259-pypy_41-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-pp259-pypy_41-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f377d84c3688fd10f8b7dd05e9e9fc032716b61d5c410824d39c866537ce7a99
MD5 8dfd5c1bd0861c22a3d1affe8a7c7dc6
BLAKE2b-256 95e6b936cb3b92d9fe1b3dbfe85af1fb803a5a6affab712d806f9bb37c617ef5

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-pp258-pypy_41-win32.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-pp258-pypy_41-win32.whl
Algorithm Hash digest
SHA256 fee0b55d46c48cef1b838daa873790e3c18d01a6a5b33bd9e78bd8bb3037233c
MD5 0d4eecef4fb03d2c864902398305bf4d
BLAKE2b-256 1e4c156e8cdbc7e49b0b63ef599deea7eb75fe96b32d0d644a0cfaa69156fd16

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-pp258-pypy_41-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-pp258-pypy_41-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7abf156fef27dfe5565838cc6bed97ffe287e52c3680dc7c9fc67199c47467b2
MD5 857304c689ef19e4bd30927df318e3a1
BLAKE2b-256 c57e87fcf8c7e765926534e6dfe89688f27eb83cceb9b212d64a0f1b741b5acd

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-pp257-pypy_41-win32.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-pp257-pypy_41-win32.whl
Algorithm Hash digest
SHA256 dc35b6c8304e0d634e5d3f4a40222af973628ec216cb5f964bfae89293df801c
MD5 c8e684cbb0e78ee8ae27c3cec1ab1ae4
BLAKE2b-256 2590e88d118d8fa4f3a1e31b7a6561b87f6f2049baa572e61c91c9031fc3d4b1

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-pp257-pypy_41-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-pp257-pypy_41-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7fe513d9ba1d89ad020ea3b26820e7bc8a9ecf30d5ff75de000ab3aab87f1878
MD5 5bac180f85fb19496450f5f45c07ff35
BLAKE2b-256 a438c37a0621f0212fad08c44781c3664618a9d33e45cf042d89ac265d4cf77b

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 91164892f12a783f442b3246c0a7322e450469d71a06cd9090f034d90e8d617e
MD5 63cb64ff58b27f25cee02870e9357b07
BLAKE2b-256 61d136e79fec822bc1ad0864532ee4eac275c1f76ef2c55946fae1aaad1baffc

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp36-cp36m-win32.whl.

File metadata

  • Download URL: tdl-4.2.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 787.6 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tdl-4.2.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 e2c0d3b9d842fafed89e3da1bccdae80b5a95ba402e217090ed4088abd1e47fc
MD5 c26f56a8d22ee09d850c7982e3901df7
BLAKE2b-256 b631b92ce12bd1abe095fbafce9ccc129837a13748390080b9b348d8564d0a86

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 fb32c9dfcc1180c84b572483704fea406060a89abaf40c2ff0d341b5185b1d41
MD5 2d5ca0fb50c1aa50b1f636ec1fbe25dc
BLAKE2b-256 da7429d60f02bd8b5d4f38b73d9e0b543dd37620487174c506d844aabdd5d00e

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp35-cp35m-win32.whl.

File metadata

  • Download URL: tdl-4.2.3-cp35-cp35m-win32.whl
  • Upload date:
  • Size: 787.6 kB
  • Tags: CPython 3.5m, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tdl-4.2.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 82013658a73f9e21c2b400b9c5ced4a3aab411eb64e7a9f22af4d15c36b34de8
MD5 29ecff73c982118007d4ff273d8bb7b2
BLAKE2b-256 e2c1bf580e7dc2cfff5d80e6f57c2d64b2a769d98d5c97ac31e10174bf80c90a

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 0fb0183581ba947e536b16fc37e4c7ae03e498a3ab7493aabe73249f490d3def
MD5 c3992825d66fb4729ec9ebbae82ac846
BLAKE2b-256 cc416acc0a6dee8b64e16b1243507f3dd84370114edf431ad713008f2e2dd73c

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp34-cp34m-win32.whl.

File metadata

  • Download URL: tdl-4.2.3-cp34-cp34m-win32.whl
  • Upload date:
  • Size: 791.6 kB
  • Tags: CPython 3.4m, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tdl-4.2.3-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 1ccfd2ef660c638057cccffdc0f636a370536a094c539e0573fe7002564e9184
MD5 85d0778b83a71f01db0ff8e3cf5bc928
BLAKE2b-256 4eb27374fa08707868cf9b50ca64c5003be4c202268a61664c6221a2289ffff3

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp34-abi3-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-cp34-abi3-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 b58474a85b741598d307e29a8e48fd55b10349294f903a5a428b777ac99b743b
MD5 887b6123751627b297ff9444071ed2c4
BLAKE2b-256 f98fff07f4ce8978a112315a4fbe602a2be529acb4ebebaf8c4718f988accaf9

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 ec3543e9e34b9d6fadc1f55d7360ad57dc4130dde7724428b6bfcdeb3c5566c6
MD5 67372550ffb79e70498a92e622ebbe23
BLAKE2b-256 a1dbeb25d98cfe512f9cbe5ead1b67780353c48092f3551aa1d6363051f408a2

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp27-cp27m-win32.whl.

File metadata

  • Download URL: tdl-4.2.3-cp27-cp27m-win32.whl
  • Upload date:
  • Size: 785.6 kB
  • Tags: CPython 2.7m, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tdl-4.2.3-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 56eb41755fc58ef4895c076d49d2b6355fdc7235b01aeefb62b151fb57009b52
MD5 e8582cfa9f9668674df86c8f12a81d6d
BLAKE2b-256 1a762b539bdc7a1d915902baf481e352755809503981de11183497d3a127b41c

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp27-cp27m-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-cp27-cp27m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bcea1e61688367162db94807432e44e29f0f7c0b421312a2bc0a2b92acf2ad5e
MD5 017d77184b3d9343d46195a0d72e4e4c
BLAKE2b-256 40711a95f7b1d925e1b60a0b1de9b0da6d3c98556964a67c0f828641bccdb3b6

See more details on using hashes here.

File details

Details for the file tdl-4.2.3-cp27-cp27m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for tdl-4.2.3-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d598109d9f8fda6a5b56411317bc639d54301753bfa2774563e5cfcecfd7718c
MD5 fd12047674898f5b8fda4b2a90510ded
BLAKE2b-256 b119ebe6b1411dba0803c1a96cb382491c1d8f220d1d838cda6a12858be1a307

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page