Releases: libtcod/python-tcod
Releases · libtcod/python-tcod
21.2.1
Deployment
- PyPy wheels switched from PyPy 3.10 to PyPy 3.11.
- Experimental Pyodide wheels are now uploaded to PyPI.
Fixed
tcod.sdl.joystick.get_joysticks,get_controllers, and related enumeration passed device indices to SDL3 functions expecting instance IDs, so enumeration could fail or open the wrong device after a joystick was reconnected.
21.2.0
Added
tcod.event.MouseWheelnow haswhich,window_id,positionandinteger_positionattributes.
Fixed
tcod.event.convert_coordinates_from_windowwas not converting all types of mouse events.
21.1.0
Added
MouseButtonEvent.integer_positionproperty.
Fixed
integer_positionwas missing from mouse button events.
21.0.0
Added
tcod.sdl.video.Windownow accepts an SDL WindowID.tcod.event:MouseState.integer_positionandMouseMotion.integer_motionto handle cases where integer values are preferred.ClipboardUpdateevent.Dropevent.KeyboardEvent.pressed,KeyboardEvent.which,KeyboardEvent.window_idattributes.WindowEvent.dataandWindowEvent.window_idattributes and added missing SDL3 window events.whichandwindow_idattributes for mouse events.- Events now have
Event.timestampandEvent.timestamp_nswhich use SDL's timer attcod.event.timeandtcod.event.time_ns.
Changed
- Event classes are now more strict with attribute types
- Event class initializers are keyword-only and no longer take a type parameter, with exceptions.
Generally event class initialization is an internal process. MouseButtonEventno longer a subclass ofMouseState.tcod.event.Pointis now a generic type containingintorfloatvalues depending on the context.- When converting mouse events to tiles:
MouseState.positionandMouseMotion.motionrefers to sub-tile coordinates.
MouseState.integer_positionandMouseMotion.integer_motionrefers to integer tile coordinates.
Deprecated
Event.typeis deprecated except for special cases such asControllerDevice,WindowEvent, etc.MouseButtonEvent.stateis deprecated, replaced by the existing.buttonattribute.
Fixed
- Fixed incorrect C FFI types inside
tcod.event.get_mouse_state. - Fixed regression in mouse event tile coordinates being
floatinstead ofint.
convert_coordinates_from_windowcan be used if sub-tile coordinates were desired. - Fixed regression in
libtcodpy.bsp_split_recursivenot accepting0.
20.1.0
Added
Tilesetnow supportsMutableMappingsemantics.
Can get, set, or iterate over tiles as if it were a dictionary containing tile glyph arrays.
Also supports+,|,+=, and|=with other tilesets or mappings to merge them into a single Tileset.tcod.tileset.procedural_block_elementscan take a tile shape and return a tileset.
Deprecated
Tileset.set_tile(codepoint, tile)was replaced withtileset[codepoint] = tilesyntax.Tileset.get_tile(codepoint)was soft replaced withtileset[codepoint]syntax.tcod.tileset.procedural_block_elementsshould be used with dictionary semantics instead of passing in a tileset.
20.0.0
Added
- Now supports free-threaded Python, deploys with
cp314twheels. - Added methods:
Renderer.coordinates_from_windowandRenderer.coordinates_to_window - Added
tcod.event.convert_coordinates_from_window.
Changed
Renderer.logical_sizenow returnsNoneinstead of(0, 0)when logical size is unset.
19.6.3
Fix missing deployment
19.6.2
Changed
- Update to libtcod 2.2.2
Fixed
- Mouse coordinate to tile conversions now support SDL renderer logical size and scaling.
19.6.1
Fixed
tcod.event.add_watchwas crashing due to a cdef type mismatch.
19.6.0
Added
- Alternative syntax for number symbols with
KeySym, can now specifyKeySym["3"], etc.
Only available on Python 3.13 or later.
Fixed
- Fixed regression with lowercase key symbols with
tcod.event.K_*andKeySym.*constants, these are still deprecated.
Event constants are only fixed fortcod.event.K_*, not the undocumentedtcod.event_constantsmodule.
LowercaseKeySym.*constants are only available on Python 3.13 or later. BSP.split_recursivedid not accept aRandomclass as the seed. #168