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.2 - 2018-01-06

Fixed
  • The Win dynamic linker will now prefer the bundled version of SDL, 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.2.tar.gz (945.7 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.2-pp259-pypy_41-win32.whl (711.1 kB view details)

Uploaded PyPyWindows x86

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

Uploaded PyPymacOS 10.12+ x86-64

tdl-4.2.2-pp258-pypy_41-win32.whl (711.0 kB view details)

Uploaded PyPyWindows x86

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

Uploaded PyPymacOS 10.12+ x86-64

tdl-4.2.2-pp257-pypy_41-win32.whl (711.0 kB view details)

Uploaded PyPyWindows x86

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

Uploaded PyPymacOS 10.12+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

tdl-4.2.2-cp34-cp34m-win_amd64.whl (954.6 kB view details)

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

tdl-4.2.2-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.2-cp27-cp27m-win_amd64.whl (956.0 kB view details)

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

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

Uploaded CPython 2.7mmacOS 10.12+ x86-64

tdl-4.2.2-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.2.tar.gz.

File metadata

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

File hashes

Hashes for tdl-4.2.2.tar.gz
Algorithm Hash digest
SHA256 efbbd7c868be2447c05e8290465a5c1e5781a7e8f934a931a0d71efa52eeea53
MD5 73c6eff2f35226645cca72dc97e629f7
BLAKE2b-256 c36b553f4ad18262fb60385905c466e2334d26f41a1b2272d2115e65c7b12d79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-pp259-pypy_41-win32.whl
Algorithm Hash digest
SHA256 4f628c13338be5a09c53bb001c78c58bd470927e7b699b91b22d1446b3aa2a11
MD5 6427c4e8584e259365b2c04609cccdf5
BLAKE2b-256 fd793be8215b5b741bb3be2745cebde7452d2d87f85778e31ce8c85af9a6e0d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-pp259-pypy_41-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c74c7fbf115ebcb1377e281980fb7f3b3f00fe83a61c332439f4e9c8b2388cf9
MD5 eb6bee1ab0a51d4a81c98e20099cd14c
BLAKE2b-256 7b5c5c647d5c892d09bf59d8a3f240b39403c55ef6a37b4f6526768a151f4e2c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-pp258-pypy_41-win32.whl
Algorithm Hash digest
SHA256 59c4794025ef594cf1820811b1e5241f42c18f219d078c41a39b1cf5fd23bc26
MD5 a4233ecddf49395f6cf0d4a872726a49
BLAKE2b-256 58b9ed5c84b0e51a1441a2770e6430a9de2cb96eb75fa9a1a82e55dcee021ff7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-pp258-pypy_41-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4c7a2516685b8aef4e010ab5b28793b77c832cddf66a6289c26747c082051add
MD5 a9b0f392d87c7ba6b71537a708f4e1c6
BLAKE2b-256 968440e7e4cef0710785ac9dab7bfff7b2941f85256780c5489a2461f3725cdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-pp257-pypy_41-win32.whl
Algorithm Hash digest
SHA256 f8be204bf9ed4a95078c37aade86e408b82e00031e7e964646feb7b0c4d19688
MD5 c681a332860c11d3088345e3cd7cb8dc
BLAKE2b-256 d0446240879ceb26e10fc23890f75390c47da4456bfd343026e58e980db89e2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-pp257-pypy_41-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3a040d3739d07cd4bfb79c60f883c67fe1f19dc276b5debbda4d095fda561c79
MD5 a17edeb75835994835c4cdba312bb48c
BLAKE2b-256 d2f9813b251d9a6d04bca97ecc20e087c240055cd89bdd2219c51cd5fc76b127

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d5dfb7362af2e4d891653bdd06833d8b7f485d572fe93a8665cb91285be4d104
MD5 b1db43d63a47c90d5a67bf3ccd10349a
BLAKE2b-256 a6bf8cb1b8ee00a2b35210a3f35108d6152cb8b28e24ce94b01b12954ce91ba1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tdl-4.2.2-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.2-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 c5ad20495ec4a915ac550c3f1f60b4aa8e8b065a846c9a55453c90fc4bc2ef65
MD5 90a6afa32800ad771530fbc48dddff17
BLAKE2b-256 9f8844f8ca5f6f2f00451f50831cd2944e4da786e8d23d46fe0d5026b9945e9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 e760c7507daf03320fca319f87c51c2a36f8ea0504f80c6a03e5b88525db9aa8
MD5 e822f95abd0b18011da509428f31fa8c
BLAKE2b-256 c48f8994105fe095c857d08d3d02dc803bd7a4600e7b53f5897da674344ac84b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tdl-4.2.2-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.2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 fd4772aea9f0a68db259e8df90447ae9a778d30b0129e8bd3de258559c7aa611
MD5 c5d57ec96495299f9d1bfa36fc55545e
BLAKE2b-256 cde444bc86d741f363e6fd0178d8e5653d5f04311848519d282c8316fe754dff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 eb92039d16a0df62bacf3891842101464b1302590ac47cdc22336ab330d2a1b1
MD5 2af972347f15df09897545eaa7d7cc16
BLAKE2b-256 fb7fcd7ac47e7e5d5f2a48b000b52d6c88a96aadeebc8450a048e59285ee7685

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tdl-4.2.2-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.2-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 f80488c6c15b452866a39915eaba0f56f228913112a043a9ba55cb0eb9c3cb72
MD5 deb1c17263d90b4b6c0e9ad15f50c068
BLAKE2b-256 3d25c469caabf1cf31d77e45c7ad68d54e870c49700a7569788f7dd6cd328584

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-cp34-abi3-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 ea1fb3e15ba26d1a0c7e9f6dd7acc736dc1f62506c128c46cafe1f76259ed60a
MD5 659aad41db464dbf2dbd2813c0a6588e
BLAKE2b-256 181058532b890895c5a75c802ab9eb4b973b14cc182bfd396351250ebef8a94f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 6d6bb3224e7234e490772f08fada1d3169690734ca7a3e8b1bed8a61ae78c3c7
MD5 451cdb38b18e6b58aafcb831b73c4ef3
BLAKE2b-256 00c3ff17b4e4ffa162398fdf10fe5393a36c742e567b818f56ec1e509f6f3e0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tdl-4.2.2-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.2-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 764c88b1f2cd695cd46c177ad9a391d110934cc4659b58e0d5725b43a8908068
MD5 162c119bb11710953534b3e6561d6a96
BLAKE2b-256 f03ea1438326b06cf620f423be6077aeb89fd1c9f6cdb4980a92000446f8bbd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-cp27-cp27m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0533e13514e2f48a4b0da6ab108ef73a8e7f3b7db7e6994750d49cc72abec795
MD5 f8027a36cd794493b2d9ece18396d4ac
BLAKE2b-256 9e8f17a48208628233e54914355cc8ea2dab91e458112e1710107ed3c7152ce5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.2-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 98ac16549abcb107ea789a5bec0dff0603f9c07f6c52f4ceb611776c8ededeff
MD5 c8d901c01bc41025a46f78ae8618bfb6
BLAKE2b-256 74136b8ae8492df40d326f429ddc085765f395f62d8fe284783f081fb76e2549

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