You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.