Skip to content

21.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Mar 22:57
21.0.0
a954fa3

Added

  • tcod.sdl.video.Window now accepts an SDL WindowID.
  • tcod.event:
    • MouseState.integer_position and MouseMotion.integer_motion to handle cases where integer values are preferred.
    • ClipboardUpdate event.
    • Drop event.
    • KeyboardEvent.pressed, KeyboardEvent.which, KeyboardEvent.window_id attributes.
    • WindowEvent.data and WindowEvent.window_id attributes and added missing SDL3 window events.
    • which and window_id attributes for mouse events.
    • Events now have Event.timestamp and Event.timestamp_ns which use SDL's timer at tcod.event.time and tcod.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.
  • MouseButtonEvent no longer a subclass of MouseState.
  • tcod.event.Point is now a generic type containing int or float values depending on the context.
  • When converting mouse events to tiles:
    MouseState.position and MouseMotion.motion refers to sub-tile coordinates.
    MouseState.integer_position and MouseMotion.integer_motion refers to integer tile coordinates.

Deprecated

  • Event.type is deprecated except for special cases such as ControllerDevice, WindowEvent, etc.
  • MouseButtonEvent.state is deprecated, replaced by the existing .button attribute.

Fixed

  • Fixed incorrect C FFI types inside tcod.event.get_mouse_state.
  • Fixed regression in mouse event tile coordinates being float instead of int.
    convert_coordinates_from_window can be used if sub-tile coordinates were desired.
  • Fixed regression in libtcodpy.bsp_split_recursive not accepting 0.