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

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.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.0.tar.gz (944.9 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.0-pp259-pypy_41-win32.whl (710.6 kB view details)

Uploaded PyPyWindows x86

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

Uploaded PyPymacOS 10.12+ x86-64

tdl-4.2.0-pp258-pypy_41-win32.whl (710.5 kB view details)

Uploaded PyPyWindows x86

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

Uploaded PyPymacOS 10.12+ x86-64

tdl-4.2.0-pp257-pypy_41-win32.whl (710.5 kB view details)

Uploaded PyPyWindows x86

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

Uploaded PyPymacOS 10.12+ x86-64

tdl-4.2.0-cp36-cp36m-win_amd64.whl (953.2 kB view details)

Uploaded CPython 3.6mWindows x86-64

tdl-4.2.0-cp36-cp36m-win32.whl (787.0 kB view details)

Uploaded CPython 3.6mWindows x86

tdl-4.2.0-cp35-cp35m-win_amd64.whl (953.2 kB view details)

Uploaded CPython 3.5mWindows x86-64

tdl-4.2.0-cp35-cp35m-win32.whl (787.0 kB view details)

Uploaded CPython 3.5mWindows x86

tdl-4.2.0-cp34-cp34m-win_amd64.whl (954.0 kB view details)

Uploaded CPython 3.4mWindows x86-64

tdl-4.2.0-cp34-cp34m-win32.whl (791.1 kB view details)

Uploaded CPython 3.4mWindows x86

tdl-4.2.0-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.0-cp27-cp27m-win_amd64.whl (955.5 kB view details)

Uploaded CPython 2.7mWindows x86-64

tdl-4.2.0-cp27-cp27m-win32.whl (785.0 kB view details)

Uploaded CPython 2.7mWindows x86

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

Uploaded CPython 2.7mmacOS 10.12+ x86-64

tdl-4.2.0-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.0.tar.gz.

File metadata

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

File hashes

Hashes for tdl-4.2.0.tar.gz
Algorithm Hash digest
SHA256 605ab214530b3ae1b3a3bb8c801b5c3e96a8db6a278734ea05256788118ce698
MD5 e85bb070505adb9a0184e16c200cd2d8
BLAKE2b-256 ea7f5d4cef8843124c8e04cb7cc02f9c5b48cbb0ba3eaec18d4ceafb01434bd7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-pp259-pypy_41-win32.whl
Algorithm Hash digest
SHA256 93e4085f1027e2407ded1f747d32fac1c32cbb1043a2a586ce0d196113c5dd6e
MD5 514e069a0be9b71abd89ae9f6608d86a
BLAKE2b-256 028a726f8a028c079ff9e5d1a59f656c472abf2a9f837d7891af214fa03f9519

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-pp259-pypy_41-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5cf6b06ad999c60a2216fdf3c590a0d21f8350736e92bd0aad64e1c0aae17311
MD5 087cd723459eaf577642892c24781638
BLAKE2b-256 9ed70c0daa6ba1af8063c93dc04824c4b1d4e7cabd6359eeae49c55cdbd60a82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-pp258-pypy_41-win32.whl
Algorithm Hash digest
SHA256 b8017de3ad39764183ac13e9ef24e4a28e2fc1c006179ebf996ccfb9ed27c470
MD5 4dec31b733c87b20fd49915beae5b06f
BLAKE2b-256 360e4210b1656edad11fa372b59744d0fd03168a14b85b8ab3a7498a886cd2b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-pp258-pypy_41-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a002829ad670b3acc2a8726e8d16e8b4682de95067c1e32c2e428909bc54a746
MD5 ef9bf6eab246274c2be7e6d3f70546ee
BLAKE2b-256 95e81d7a8a6a36b1e44078d13d93771af43f91e7718f87f0cbebe1a3ef8f6b27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-pp257-pypy_41-win32.whl
Algorithm Hash digest
SHA256 76ad014cf6e68f70d237b4814b4f9b9ae7449b9a5f1b6d33e812d629fe9e760f
MD5 d3cf9791b1a8d456b4dc575aeb27bebf
BLAKE2b-256 1c2e8d60693cd0c4d8796716bdde8188ffd2245bbc4c4525d77e34f79af034b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-pp257-pypy_41-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 44f7a13dca9b5179f1e69b6041c17905fe0c81ea0e6b25d116edb5d181c4c790
MD5 de9873146610fed3d8d4d869e69f319a
BLAKE2b-256 0230a2256ef122d25703e638bb2bc522c922491d4c1e03bab99d789cf3a9ae0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e32dd3fce6ba1457252af2952a330c26af05013e506280f15e2d6a9a8e6d1e97
MD5 5595e4afcbc97df15300c5a94ba712cc
BLAKE2b-256 7a11a2d48cf7e90219990398e904490da3d8a11e974e51932f8c3997bf6a1ffc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tdl-4.2.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 c123b33b519d597772295f41739459a0096578580e7c27c69dfe2ffa52a1950d
MD5 30ff641141989df026bc7cf27589f6b0
BLAKE2b-256 73400dfbef8d21c15c10e39234d97a024b68a2facbb491661bc983a0cbd95e0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 51391b10b6577bb09dd49bb90a2bee1fea82bfb591d709c48151fceefb6b3ab9
MD5 592aef6a9f06402e4d2dc918c5887bc4
BLAKE2b-256 af1b4bcf826e948aa7d239b357b345917365b434d8962c2a40e8a45f52911dc3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tdl-4.2.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 1e4497dfb70f5ca6812e8629334796fa0782b2a599de8073926a1f961dce94e9
MD5 dccc8f6f64a2b57d67d96f028a11026c
BLAKE2b-256 49c1d87d4603d827fd40ea17315683067d0c729992a85fd1d1ec1cc612b9fe9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 158b3ab5e6afbf12f20c597a6d41dab42e35436b0fc6a495271f311efb030bbd
MD5 deb516398c7a86f1a127f32da25ad2fa
BLAKE2b-256 afa5cc9d58d0229f2e69f5130e4136fba89ae2113eacfa520dd7d1e12f0b8db5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tdl-4.2.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 0865ee631d47eb4515fe5c0bdbae4560840bc1bd7350ca1703dc209f3f7e55e4
MD5 3ac04590861952a5401d9041b42daad6
BLAKE2b-256 175420ab1f13fa346204918d5d3b63cc7ea0fa45a8f644d8b221954a8f93760f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-cp34-abi3-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 4a1ace32816e074c809ddfde818c48f3845c27f09718229042c930b9103b7287
MD5 bff4a3b05f6f62bd5585afd539d398ef
BLAKE2b-256 ee797b942e4785a2ee268b92fa80625ad90d9e72422046976569ee2fae1288c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 c321edd07b9cacdf946ecbc986fc7097c60abf44715c17c31d38f19ba9dfd59d
MD5 2ede361105d2b469b639e34557a56421
BLAKE2b-256 50b06519f0c212efccbcd88cf0cd08b506801589fd66a84d803c6a5103d27f4c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tdl-4.2.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 a14ddd07592179e94a0e01564e60ab7a96fe4a66d6a91b4b8d9091bb67ac961e
MD5 9a32db2bce0d628b76bc3690eb21eaeb
BLAKE2b-256 a8f71bd0bb99df14029ff5fd4efc29460177c4b5139d517c62bfa39e3090483f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-cp27-cp27m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6b35ba26b46417c09cb17176ed0d18939468ef45301a8d793d40e7448b58fbc7
MD5 01f001108f4f9351434f8563f5047d35
BLAKE2b-256 6ed4f37706b923c1cf49d23e3a935a39216eb5c5b78215adcf81f7803d2782cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tdl-4.2.0-cp27-cp27m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 adfe20b9b5c31fb09c0662c0189f7c9175b1941c66b25c79e82f8e26e14f822c
MD5 84ed941c9620d7af8aa71cfbe8b16e85
BLAKE2b-256 2e300cdd8bb6e73008e80f68c20b945627dec2511c12506c32a5b9f9c3d6a3c8

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