kraken-engine 1.0.0__cp311-cp311-macosx_11_0_arm64.whl → 1.3.0__cp311-cp311-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
  import collections.abc
3
3
  import enum
4
4
  import typing
5
+ from . import collision
5
6
  from . import color
6
7
  from . import draw
7
8
  from . import ease
@@ -16,8 +17,20 @@ from . import rect
16
17
  from . import renderer
17
18
  from . import time
18
19
  from . import transform
20
+ from . import viewport
19
21
  from . import window
20
- __all__: list[str] = ['AUDIO_DEVICE_ADDED', 'AUDIO_DEVICE_FORMAT_CHANGED', 'AUDIO_DEVICE_REMOVED', 'Anchor', 'Animation', 'AnimationController', 'Audio', 'AudioStream', 'BOTTOM_LEFT', 'BOTTOM_MID', 'BOTTOM_RIGHT', 'CAMERA_ADDED', 'CAMERA_APPROVED', 'CAMERA_DENIED', 'CAMERA_REMOVED', 'CENTER', 'C_BACK', 'C_DPAD_DOWN', 'C_DPAD_LEFT', 'C_DPAD_RIGHT', 'C_DPAD_UP', 'C_EAST', 'C_GUIDE', 'C_LSHOULDER', 'C_LSTICK', 'C_LTRIGGER', 'C_LX', 'C_LY', 'C_NORTH', 'C_PS3', 'C_PS4', 'C_PS5', 'C_RSHOULDER', 'C_RSTICK', 'C_RTRIGGER', 'C_RX', 'C_RY', 'C_SOUTH', 'C_STANDARD', 'C_START', 'C_SWITCH_JOYCON_LEFT', 'C_SWITCH_JOYCON_PAIR', 'C_SWITCH_JOYCON_RIGHT', 'C_SWITCH_PRO', 'C_WEST', 'C_XBOX_360', 'C_XBOX_ONE', 'Camera', 'Circle', 'Color', 'DROP_BEGIN', 'DROP_COMPLETE', 'DROP_FILE', 'DROP_POSITION', 'DROP_TEXT', 'EasingAnimation', 'Event', 'EventType', 'Font', 'Frame', 'GAMEPAD_ADDED', 'GAMEPAD_AXIS_MOTION', 'GAMEPAD_BUTTON_DOWN', 'GAMEPAD_BUTTON_UP', 'GAMEPAD_REMOVED', 'GAMEPAD_TOUCHPAD_DOWN', 'GAMEPAD_TOUCHPAD_MOTION', 'GAMEPAD_TOUCHPAD_UP', 'GamepadAxis', 'GamepadButton', 'GamepadType', 'InputAction', 'KEYBOARD_ADDED', 'KEYBOARD_REMOVED', 'KEY_DOWN', 'KEY_UP', 'K_0', 'K_1', 'K_2', 'K_3', 'K_4', 'K_5', 'K_6', 'K_7', 'K_8', 'K_9', 'K_AGAIN', 'K_AMPERSAND', 'K_ASTERISK', 'K_AT', 'K_BACKSLASH', 'K_BACKSPACE', 'K_CAPS', 'K_CARET', 'K_COLON', 'K_COMMA', 'K_COPY', 'K_CUT', 'K_DBLQUOTE', 'K_DEL', 'K_DOLLAR', 'K_DOWN', 'K_END', 'K_EQ', 'K_ESC', 'K_EXCLAIM', 'K_F1', 'K_F10', 'K_F11', 'K_F12', 'K_F2', 'K_F3', 'K_F4', 'K_F5', 'K_F6', 'K_F7', 'K_F8', 'K_F9', 'K_FIND', 'K_GRAVE', 'K_GT', 'K_HASH', 'K_HOME', 'K_INS', 'K_KP_0', 'K_KP_1', 'K_KP_2', 'K_KP_3', 'K_KP_4', 'K_KP_5', 'K_KP_6', 'K_KP_7', 'K_KP_8', 'K_KP_9', 'K_KP_DIV', 'K_KP_ENTER', 'K_KP_MINUS', 'K_KP_MULT', 'K_KP_PERIOD', 'K_KP_PLUS', 'K_LALT', 'K_LBRACE', 'K_LBRACKET', 'K_LCTRL', 'K_LEFT', 'K_LGUI', 'K_LPAREN', 'K_LSHIFT', 'K_LT', 'K_MINUS', 'K_MUTE', 'K_NUMLOCK', 'K_PASTE', 'K_PAUSE', 'K_PERCENT', 'K_PERIOD', 'K_PGDOWN', 'K_PGUP', 'K_PIPE', 'K_PLUS', 'K_PRTSCR', 'K_QUESTION', 'K_RALT', 'K_RBRACE', 'K_RBRACKET', 'K_RCTRL', 'K_RETURN', 'K_RGUI', 'K_RIGHT', 'K_RPAREN', 'K_RSHIFT', 'K_SCRLK', 'K_SEMICOLON', 'K_SGLQUOTE', 'K_SLASH', 'K_SPACE', 'K_TAB', 'K_TILDE', 'K_UNDERSCORE', 'K_UNDO', 'K_UP', 'K_VOLDOWN', 'K_VOLUP', 'K_a', 'K_b', 'K_c', 'K_d', 'K_e', 'K_f', 'K_g', 'K_h', 'K_i', 'K_j', 'K_k', 'K_l', 'K_m', 'K_n', 'K_o', 'K_p', 'K_q', 'K_r', 'K_s', 'K_t', 'K_u', 'K_v', 'K_w', 'K_x', 'K_y', 'K_z', 'Keycode', 'Layer', 'Line', 'MID_LEFT', 'MID_RIGHT', 'MOUSE_ADDED', 'MOUSE_BUTTON_DOWN', 'MOUSE_BUTTON_UP', 'MOUSE_MOTION', 'MOUSE_REMOVED', 'MOUSE_WHEEL', 'M_LEFT', 'M_MIDDLE', 'M_RIGHT', 'M_SIDE1', 'M_SIDE2', 'Mask', 'MouseButton', 'PEN_AXIS', 'PEN_BUTTON_DOWN', 'PEN_BUTTON_UP', 'PEN_DOWN', 'PEN_MOTION', 'PEN_PROXIMITY_IN', 'PEN_PROXIMITY_OUT', 'PEN_UP', 'P_DISTANCE', 'P_PRESSURE', 'P_ROTATION', 'P_SLIDER', 'P_TANGENTIAL_PRESSURE', 'P_TILT_X', 'P_TILT_Y', 'PenAxis', 'PixelArray', 'PolarCoordinate', 'Polygon', 'QUIT', 'Rect', 'S_0', 'S_1', 'S_2', 'S_3', 'S_4', 'S_5', 'S_6', 'S_7', 'S_8', 'S_9', 'S_AGAIN', 'S_APOSTROPHE', 'S_BACKSLASH', 'S_BACKSPACE', 'S_CAPS', 'S_COMMA', 'S_COPY', 'S_CUT', 'S_DEL', 'S_DOWN', 'S_END', 'S_EQ', 'S_ESC', 'S_F1', 'S_F10', 'S_F11', 'S_F12', 'S_F2', 'S_F3', 'S_F4', 'S_F5', 'S_F6', 'S_F7', 'S_F8', 'S_F9', 'S_FIND', 'S_GRAVE', 'S_HOME', 'S_INS', 'S_KP_0', 'S_KP_1', 'S_KP_2', 'S_KP_3', 'S_KP_4', 'S_KP_5', 'S_KP_6', 'S_KP_7', 'S_KP_8', 'S_KP_9', 'S_KP_DIV', 'S_KP_ENTER', 'S_KP_MINUS', 'S_KP_MULT', 'S_KP_PERIOD', 'S_KP_PLUS', 'S_LALT', 'S_LBRACKET', 'S_LCTRL', 'S_LEFT', 'S_LGUI', 'S_LSHIFT', 'S_MINUS', 'S_MUTE', 'S_NUMLOCK', 'S_PASTE', 'S_PAUSE', 'S_PERIOD', 'S_PGDOWN', 'S_PGUP', 'S_PRTSCR', 'S_RALT', 'S_RBRACKET', 'S_RCTRL', 'S_RETURN', 'S_RGUI', 'S_RIGHT', 'S_RSHIFT', 'S_SCRLK', 'S_SEMICOLON', 'S_SLASH', 'S_SPACE', 'S_TAB', 'S_UNDO', 'S_UP', 'S_VOLDOWN', 'S_VOLUP', 'S_a', 'S_b', 'S_c', 'S_d', 'S_e', 'S_f', 'S_g', 'S_h', 'S_i', 'S_j', 'S_k', 'S_l', 'S_m', 'S_n', 'S_o', 'S_p', 'S_q', 'S_r', 'S_s', 'S_t', 'S_u', 'S_v', 'S_w', 'S_x', 'S_y', 'S_z', 'Scancode', 'TEXT_EDITING', 'TEXT_INPUT', 'TOP_LEFT', 'TOP_MID', 'TOP_RIGHT', 'Texture', 'Tile', 'TileMap', 'Timer', 'Vec2', 'WINDOW_ENTER_FULLSCREEN', 'WINDOW_EXPOSED', 'WINDOW_FOCUS_GAINED', 'WINDOW_FOCUS_LOST', 'WINDOW_HIDDEN', 'WINDOW_LEAVE_FULLSCREEN', 'WINDOW_MAXIMIZED', 'WINDOW_MINIMIZED', 'WINDOW_MOUSE_ENTER', 'WINDOW_MOUSE_LEAVE', 'WINDOW_MOVED', 'WINDOW_OCCLUDED', 'WINDOW_RESIZED', 'WINDOW_RESTORED', 'WINDOW_SHOWN', 'color', 'draw', 'ease', 'event', 'gamepad', 'init', 'input', 'key', 'line', 'math', 'mouse', 'quit', 'rect', 'renderer', 'time', 'transform', 'window']
22
+ __all__: list[str] = ['AUDIO_DEVICE_ADDED', 'AUDIO_DEVICE_FORMAT_CHANGED', 'AUDIO_DEVICE_REMOVED', 'Align', 'Anchor', 'Animation', 'AnimationController', 'Audio', 'AudioStream', 'CAMERA_DEVICE_ADDED', 'CAMERA_DEVICE_APPROVED', 'CAMERA_DEVICE_DENIED', 'CAMERA_DEVICE_REMOVED', 'CLIPBOARD_UPDATE', 'C_BACK', 'C_DPAD_DOWN', 'C_DPAD_LEFT', 'C_DPAD_RIGHT', 'C_DPAD_UP', 'C_EAST', 'C_GUIDE', 'C_LSHOULDER', 'C_LSTICK', 'C_LTRIGGER', 'C_LX', 'C_LY', 'C_NORTH', 'C_PS3', 'C_PS4', 'C_PS5', 'C_RSHOULDER', 'C_RSTICK', 'C_RTRIGGER', 'C_RX', 'C_RY', 'C_SOUTH', 'C_STANDARD', 'C_START', 'C_SWITCH_JOYCON_LEFT', 'C_SWITCH_JOYCON_PAIR', 'C_SWITCH_JOYCON_RIGHT', 'C_SWITCH_PRO', 'C_WEST', 'C_XBOX_360', 'C_XBOX_ONE', 'Camera', 'Circle', 'Color', 'DID_ENTER_BACKGROUND', 'DID_ENTER_FOREGROUND', 'DISPLAY_ADDED', 'DISPLAY_CONTENT_SCALE_CHANGED', 'DISPLAY_CURRENT_MODE_CHANGED', 'DISPLAY_DESKTOP_MODE_CHANGED', 'DISPLAY_MOVED', 'DISPLAY_ORIENTATION', 'DISPLAY_REMOVED', 'DROP_BEGIN', 'DROP_COMPLETE', 'DROP_FILE', 'DROP_POSITION', 'DROP_TEXT', 'EasingAnimation', 'Event', 'EventType', 'FINGER_CANCELED', 'FINGER_DOWN', 'FINGER_MOTION', 'FINGER_UP', 'Font', 'FontHint', 'Frame', 'GAMEPAD_ADDED', 'GAMEPAD_AXIS_MOTION', 'GAMEPAD_BUTTON_DOWN', 'GAMEPAD_BUTTON_UP', 'GAMEPAD_REMAPPED', 'GAMEPAD_REMOVED', 'GAMEPAD_SENSOR_UPDATE', 'GAMEPAD_STEAM_HANDLE_UPDATED', 'GAMEPAD_TOUCHPAD_DOWN', 'GAMEPAD_TOUCHPAD_MOTION', 'GAMEPAD_TOUCHPAD_UP', 'GAMEPAD_UPDATE_COMPLETE', 'GamepadAxis', 'GamepadButton', 'GamepadType', 'InputAction', 'KEYBOARD_ADDED', 'KEYBOARD_REMOVED', 'KEYMAP_CHANGED', 'KEY_DOWN', 'KEY_UP', 'K_0', 'K_1', 'K_2', 'K_3', 'K_4', 'K_5', 'K_6', 'K_7', 'K_8', 'K_9', 'K_AGAIN', 'K_AMPERSAND', 'K_APPLICATION', 'K_ASTERISK', 'K_AT', 'K_BACKSLASH', 'K_BACKSPACE', 'K_CALL', 'K_CAPS', 'K_CARET', 'K_CHANNEL_DEC', 'K_CHANNEL_INC', 'K_COLON', 'K_COMMA', 'K_COPY', 'K_CUT', 'K_DBLQUOTE', 'K_DEL', 'K_DOLLAR', 'K_DOWN', 'K_END', 'K_ENDCALL', 'K_EQ', 'K_ESC', 'K_EXCLAIM', 'K_EXECUTE', 'K_F1', 'K_F10', 'K_F11', 'K_F12', 'K_F13', 'K_F14', 'K_F15', 'K_F2', 'K_F3', 'K_F4', 'K_F5', 'K_F6', 'K_F7', 'K_F8', 'K_F9', 'K_FIND', 'K_GRAVE', 'K_GT', 'K_HASH', 'K_HELP', 'K_HOME', 'K_INS', 'K_KP_0', 'K_KP_1', 'K_KP_2', 'K_KP_3', 'K_KP_4', 'K_KP_5', 'K_KP_6', 'K_KP_7', 'K_KP_8', 'K_KP_9', 'K_KP_DIV', 'K_KP_ENTER', 'K_KP_MINUS', 'K_KP_MULT', 'K_KP_PERIOD', 'K_KP_PLUS', 'K_LALT', 'K_LBRACE', 'K_LBRACKET', 'K_LCTRL', 'K_LEFT', 'K_LGUI', 'K_LPAREN', 'K_LSHIFT', 'K_LT', 'K_MEDIA_EJECT', 'K_MEDIA_FF', 'K_MEDIA_NEXT', 'K_MEDIA_PAUSE', 'K_MEDIA_PLAY', 'K_MEDIA_PLAY_PAUSE', 'K_MEDIA_PREV', 'K_MEDIA_REC', 'K_MEDIA_REWIND', 'K_MEDIA_SELECT', 'K_MEDIA_STOP', 'K_MENU', 'K_MINUS', 'K_MODE', 'K_MUTE', 'K_NUMLOCK', 'K_PASTE', 'K_PAUSE', 'K_PERCENT', 'K_PERIOD', 'K_PGDOWN', 'K_PGUP', 'K_PIPE', 'K_PLUS', 'K_POWER', 'K_PRTSCR', 'K_QUESTION', 'K_RALT', 'K_RBRACE', 'K_RBRACKET', 'K_RCTRL', 'K_RETURN', 'K_RGUI', 'K_RIGHT', 'K_RPAREN', 'K_RSHIFT', 'K_SCRLK', 'K_SELECT', 'K_SEMICOLON', 'K_SGLQUOTE', 'K_SLASH', 'K_SLEEP', 'K_SOFTLEFT', 'K_SOFTRIGHT', 'K_SPACE', 'K_STOP', 'K_TAB', 'K_TILDE', 'K_UNDERSCORE', 'K_UNDO', 'K_UNKNOWN', 'K_UP', 'K_VOLDOWN', 'K_VOLUP', 'K_WAKE', 'K_a', 'K_b', 'K_c', 'K_d', 'K_e', 'K_f', 'K_g', 'K_h', 'K_i', 'K_j', 'K_k', 'K_l', 'K_m', 'K_n', 'K_o', 'K_p', 'K_q', 'K_r', 'K_s', 'K_t', 'K_u', 'K_v', 'K_w', 'K_x', 'K_y', 'K_z', 'Keycode', 'LOCALE_CHANGED', 'LOW_MEMORY', 'Line', 'MOUSE_ADDED', 'MOUSE_BUTTON_DOWN', 'MOUSE_BUTTON_UP', 'MOUSE_MOTION', 'MOUSE_REMOVED', 'MOUSE_WHEEL', 'M_LEFT', 'M_MIDDLE', 'M_RIGHT', 'M_SIDE1', 'M_SIDE2', 'Mask', 'MouseButton', 'PEN_AXIS', 'PEN_BUTTON_DOWN', 'PEN_BUTTON_UP', 'PEN_DOWN', 'PEN_MOTION', 'PEN_PROXIMITY_IN', 'PEN_PROXIMITY_OUT', 'PEN_UP', 'P_DISTANCE', 'P_PRESSURE', 'P_ROTATION', 'P_SLIDER', 'P_TANGENTIAL_PRESSURE', 'P_TILT_X', 'P_TILT_Y', 'PenAxis', 'PixelArray', 'PolarCoordinate', 'Polygon', 'QUIT', 'RENDER_DEVICE_LOST', 'RENDER_DEVICE_RESET', 'RENDER_TARGETS_RESET', 'Rect', 'SENSOR_UPDATE', 'SYSTEM_THEME_CHANGED', 'S_0', 'S_1', 'S_2', 'S_3', 'S_4', 'S_5', 'S_6', 'S_7', 'S_8', 'S_9', 'S_AGAIN', 'S_APOSTROPHE', 'S_APPLICATION', 'S_BACKSLASH', 'S_BACKSPACE', 'S_CALL', 'S_CAPS', 'S_CHANNEL_DEC', 'S_CHANNEL_INC', 'S_COMMA', 'S_COPY', 'S_CUT', 'S_DEL', 'S_DOWN', 'S_END', 'S_ENDCALL', 'S_EQ', 'S_ESC', 'S_EXECUTE', 'S_F1', 'S_F10', 'S_F11', 'S_F12', 'S_F13', 'S_F14', 'S_F15', 'S_F2', 'S_F3', 'S_F4', 'S_F5', 'S_F6', 'S_F7', 'S_F8', 'S_F9', 'S_FIND', 'S_GRAVE', 'S_HELP', 'S_HOME', 'S_INS', 'S_KP_0', 'S_KP_1', 'S_KP_2', 'S_KP_3', 'S_KP_4', 'S_KP_5', 'S_KP_6', 'S_KP_7', 'S_KP_8', 'S_KP_9', 'S_KP_DIV', 'S_KP_ENTER', 'S_KP_MINUS', 'S_KP_MULT', 'S_KP_PERIOD', 'S_KP_PLUS', 'S_LALT', 'S_LBRACKET', 'S_LCTRL', 'S_LEFT', 'S_LGUI', 'S_LSHIFT', 'S_MEDIA_EJECT', 'S_MEDIA_FAST_FORWARD', 'S_MEDIA_NEXT', 'S_MEDIA_PAUSE', 'S_MEDIA_PLAY', 'S_MEDIA_PLAY_PAUSE', 'S_MEDIA_PREV', 'S_MEDIA_REC', 'S_MEDIA_REWIND', 'S_MEDIA_SELECT', 'S_MEDIA_STOP', 'S_MENU', 'S_MINUS', 'S_MODE', 'S_MUTE', 'S_NUMLOCK', 'S_PASTE', 'S_PAUSE', 'S_PERIOD', 'S_PGDOWN', 'S_PGUP', 'S_POWER', 'S_PRTSCR', 'S_RALT', 'S_RBRACKET', 'S_RCTRL', 'S_RETURN', 'S_RGUI', 'S_RIGHT', 'S_RSHIFT', 'S_SCRLK', 'S_SELECT', 'S_SEMICOLON', 'S_SLASH', 'S_SLEEP', 'S_SOFTLEFT', 'S_SOFTRIGHT', 'S_SPACE', 'S_STOP', 'S_TAB', 'S_UNDO', 'S_UP', 'S_VOLDOWN', 'S_VOLUP', 'S_WAKE', 'S_a', 'S_b', 'S_c', 'S_d', 'S_e', 'S_f', 'S_g', 'S_h', 'S_i', 'S_j', 'S_k', 'S_l', 'S_m', 'S_n', 'S_o', 'S_p', 'S_q', 'S_r', 'S_s', 'S_t', 'S_u', 'S_v', 'S_w', 'S_x', 'S_y', 'S_z', 'Scancode', 'ShaderState', 'SheetStrip', 'TERMINATING', 'TEXT_EDITING', 'TEXT_EDITING_CANDIDATES', 'TEXT_INPUT', 'Text', 'Texture', 'Tile', 'TileLayer', 'TileMap', 'Timer', 'Vec2', 'ViewportMode', 'WILL_ENTER_BACKGROUND', 'WILL_ENTER_FOREGROUND', 'WINDOW_CLOSE_REQUESTED', 'WINDOW_DESTROYED', 'WINDOW_DISPLAY_CHANGED', 'WINDOW_DISPLAY_SCALE_CHANGED', 'WINDOW_ENTER_FULLSCREEN', 'WINDOW_EXPOSED', 'WINDOW_FOCUS_GAINED', 'WINDOW_FOCUS_LOST', 'WINDOW_HDR_STATE_CHANGED', 'WINDOW_HIDDEN', 'WINDOW_HIT_TEST', 'WINDOW_ICCPROF_CHANGED', 'WINDOW_LEAVE_FULLSCREEN', 'WINDOW_MAXIMIZED', 'WINDOW_MINIMIZED', 'WINDOW_MOUSE_ENTER', 'WINDOW_MOUSE_LEAVE', 'WINDOW_MOVED', 'WINDOW_OCCLUDED', 'WINDOW_RESIZED', 'WINDOW_RESTORED', 'WINDOW_SAFE_AREA_CHANGED', 'WINDOW_SHOWN', 'collision', 'color', 'draw', 'ease', 'event', 'gamepad', 'init', 'input', 'key', 'line', 'math', 'mouse', 'quit', 'rect', 'renderer', 'time', 'transform', 'viewport', 'window']
23
+ class Align(enum.IntEnum):
24
+ CENTER: typing.ClassVar[Align] # value = <Align.CENTER: 1>
25
+ LEFT: typing.ClassVar[Align] # value = <Align.LEFT: 0>
26
+ RIGHT: typing.ClassVar[Align] # value = <Align.RIGHT: 2>
27
+ @classmethod
28
+ def __new__(cls, value):
29
+ ...
30
+ def __format__(self, format_spec):
31
+ """
32
+ Convert to a string according to format_spec.
33
+ """
21
34
  class Anchor(enum.IntEnum):
22
35
  BOTTOM_LEFT: typing.ClassVar[Anchor] # value = <Anchor.BOTTOM_LEFT: 6>
23
36
  BOTTOM_MID: typing.ClassVar[Anchor] # value = <Anchor.BOTTOM_MID: 7>
@@ -75,37 +88,27 @@ class AnimationController:
75
88
  Returns:
76
89
  bool: True if the animation completed a loop during the last update.
77
90
  """
78
- def load_folder(self, name: str, dir_path: str, fps: typing.SupportsInt) -> None:
79
- """
80
- Load animation frames from a directory of image files.
81
-
82
- Loads all valid image files from the specified directory as animation frames.
83
- Supported formats include PNG, JPG, JPEG, BMP, TGA, and GIF.
84
-
85
- Args:
86
- name (str): Unique identifier for the animation.
87
- dir_path (str): Path to the directory containing image files.
88
- fps (int): Frames per second for playback timing.
89
-
90
- Raises:
91
- RuntimeError: If no valid image files are found in the directory.
91
+ def load_sprite_sheet(self, file_path: str, frame_size: Vec2, strips: collections.abc.Sequence[SheetStrip]) -> None:
92
92
  """
93
- def load_sprite_sheet(self, name: str, file_path: str, frame_size: Vec2, fps: typing.SupportsInt) -> None:
94
- """
95
- Load animation frames from a sprite sheet texture.
93
+ Load one or more animations from a sprite sheet texture.
96
94
 
97
- Divides the sprite sheet into equal-sized frames based on the specified frame size.
98
- The frames are read left-to-right, top-to-bottom.
95
+ Divides the sprite sheet into horizontal strips, where each strip represents a different
96
+ animation. Each strip is divided into equal-sized frames based on the specified frame size.
97
+ Frames are read left-to-right within each strip, and strips are read top-to-bottom.
99
98
 
100
99
  Args:
101
- name (str): Unique identifier for the animation.
102
100
  file_path (str): Path to the sprite sheet image file.
103
101
  frame_size (Vec2): Size of each frame as (width, height).
104
- fps (int): Frames per second for playback timing.
102
+ strips (list[SheetStrip]): List of strip definitions, each containing:
103
+ - name (str): Unique identifier for the animation
104
+ - frame_count (int): Number of frames in this strip/animation
105
+ - fps (int): Frames per second for playback timing
105
106
 
106
107
  Raises:
108
+ ValueError: If frame size is not positive, no strips provided, frame count is not
109
+ positive, or frame count exceeds sprite sheet width.
107
110
  RuntimeError: If sprite sheet dimensions are not divisible by frame dimensions,
108
- or no frames are found.
111
+ duplicate animation names exist, or strip index exceeds sprite sheet height.
109
112
  """
110
113
  def pause(self) -> None:
111
114
  """
@@ -113,16 +116,30 @@ class AnimationController:
113
116
 
114
117
  Stops animation frame advancement while preserving the current frame position.
115
118
  """
116
- def remove(self, name: str) -> None:
119
+ def play(self, name: str) -> None:
117
120
  """
118
- Remove an animation from the controller.
121
+ Play an animation from the beginning.
122
+
123
+ Switches to the specified animation, rewinds it to frame 0, and starts playback.
124
+
125
+ Args:
126
+ name (str): The name of the animation to play.
127
+
128
+ Raises:
129
+ ValueError: If the specified animation name is not found.
130
+ """
131
+ def play_from(self, frame_index: typing.SupportsInt) -> None:
132
+ """
133
+ Start playing the current animation from a specific frame.
134
+
135
+ Sets the animation to the specified frame index and resumes playback. Useful for
136
+ starting animations mid-sequence or implementing custom animation logic.
119
137
 
120
138
  Args:
121
- name (str): The name of the animation to remove.
139
+ frame_index (int): The frame index to start from (0-based).
122
140
 
123
- Note:
124
- If the removed animation is currently active, the controller will be left
125
- without a current animation.
141
+ Raises:
142
+ IndexError: If the frame index is out of range for the current animation.
126
143
  """
127
144
  def resume(self) -> None:
128
145
  """
@@ -137,15 +154,15 @@ class AnimationController:
137
154
 
138
155
  Sets the animation back to frame 0 and resets loop detection state.
139
156
  """
140
- def set(self, name: str, rewind: bool = False) -> None:
157
+ def set(self, name: str) -> None:
141
158
  """
142
- Set the current active animation by name.
159
+ Set the current active animation by name without affecting playback state.
143
160
 
144
- Switches to the specified animation and resets playback to the beginning.
161
+ Switches to the specified animation while preserving the current frame index and
162
+ playback state (paused/playing). Useful for seamless animation transitions.
145
163
 
146
164
  Args:
147
165
  name (str): The name of the animation to activate.
148
- rewind (bool): Whether to rewind the animation to the start.
149
166
 
150
167
  Raises:
151
168
  ValueError: If the specified animation name is not found.
@@ -170,6 +187,27 @@ class AnimationController:
170
187
  RuntimeError: If no animation is currently set or the animation has no frames.
171
188
  """
172
189
  @property
190
+ def frame_index(self) -> int:
191
+ """
192
+ The current frame index in the animation sequence.
193
+
194
+ Returns the integer frame index (0-based) of the currently displayed frame.
195
+
196
+ Returns:
197
+ int: The current frame index.
198
+ """
199
+ @property
200
+ def looping(self) -> bool:
201
+ """
202
+ Whether the animation should loop when it reaches the end.
203
+
204
+ Returns:
205
+ bool: True if the animation is set to loop, False otherwise.
206
+ """
207
+ @looping.setter
208
+ def looping(self, arg1: bool) -> None:
209
+ ...
210
+ @property
173
211
  def playback_speed(self) -> float:
174
212
  """
175
213
  The playback speed multiplier for animation timing.
@@ -183,6 +221,18 @@ class AnimationController:
183
221
  @playback_speed.setter
184
222
  def playback_speed(self, arg1: typing.SupportsFloat) -> None:
185
223
  ...
224
+ @property
225
+ def progress(self) -> float:
226
+ """
227
+ The normalized progress through the current animation.
228
+
229
+ Returns a value between 0.0 (start) and 1.0 (end) representing how far through
230
+ the animation sequence the playback has progressed. Useful for UI progress bars
231
+ or triggering events at specific points in the animation.
232
+
233
+ Returns:
234
+ float: The animation progress as a value between 0.0 and 1.0.
235
+ """
186
236
  class Audio:
187
237
  """
188
238
 
@@ -268,16 +318,17 @@ class AudioStream:
268
318
 
269
319
  The stream position is preserved and can be resumed with resume().
270
320
  """
271
- def play(self, fade_in_ms: typing.SupportsInt = 0, loop: bool = False) -> None:
321
+ def play(self, fade_in_ms: typing.SupportsInt = 0, loop: bool = False, start_time_seconds: typing.SupportsFloat = 0.0) -> None:
272
322
  """
273
- Play the audio stream with optional fade-in time and loop setting.
323
+ Play the audio stream with optional fade-in time, loop setting, and start position.
274
324
 
275
- Rewinds the stream to the beginning and starts playback. If the stream is already
276
- playing, it will restart from the beginning.
325
+ Starts playback from the specified time position. If the stream is already
326
+ playing, it will restart from the specified position.
277
327
 
278
328
  Args:
279
329
  fade_in_ms (int, optional): Fade-in duration in milliseconds. Defaults to 0.
280
330
  loop (bool, optional): Whether to loop the audio continuously. Defaults to False.
331
+ start_time_seconds (float, optional): Time position in seconds to start playback from. Defaults to 0.0.
281
332
  """
282
333
  def resume(self) -> None:
283
334
  """
@@ -292,6 +343,16 @@ class AudioStream:
292
343
  Sets the playback position back to the start of the audio file. Does not affect
293
344
  the current play state (playing/paused).
294
345
  """
346
+ def seek(self, time_seconds: typing.SupportsFloat) -> None:
347
+ """
348
+ Seek to a specific time position in the audio stream.
349
+
350
+ Sets the playback position to the specified time in seconds. Does not affect
351
+ the current play state (playing/paused).
352
+
353
+ Args:
354
+ time_seconds (float): The time position in seconds to seek to.
355
+ """
295
356
  def set_looping(self, loop: bool) -> None:
296
357
  """
297
358
  Set whether the audio stream loops continuously.
@@ -308,6 +369,11 @@ class AudioStream:
308
369
  If > 0, fades out over the specified duration. Defaults to 0.
309
370
  """
310
371
  @property
372
+ def current_time(self) -> float:
373
+ """
374
+ The current playback time position in seconds.
375
+ """
376
+ @property
311
377
  def volume(self) -> float:
312
378
  """
313
379
  The volume level of the audio stream.
@@ -382,13 +448,9 @@ class Circle:
382
448
  """
383
449
  __hash__: typing.ClassVar[None] = None
384
450
  def __eq__(self, other: Circle) -> bool:
385
- """
386
- Check if two circles are equal.
387
- """
451
+ ...
388
452
  def __getitem__(self, index: typing.SupportsInt) -> float:
389
- """
390
- Get component by index: 0 = x, 1 = y, 2 = radius.
391
- """
453
+ ...
392
454
  @typing.overload
393
455
  def __init__(self, pos: Vec2, radius: typing.SupportsFloat) -> None:
394
456
  """
@@ -404,56 +466,15 @@ class Circle:
404
466
  Create a circle from a nested sequence: ([x, y], radius).
405
467
  """
406
468
  def __iter__(self) -> collections.abc.Iterator:
407
- """
408
- Return an iterator over (x, y, radius).
409
- """
469
+ ...
410
470
  def __len__(self) -> int:
411
- """
412
- Always returns 3 for (x, y, radius).
413
- """
471
+ ...
414
472
  def __ne__(self, other: Circle) -> bool:
415
- """
416
- Check if two circles are not equal.
417
- """
473
+ ...
418
474
  def as_rect(self) -> Rect:
419
475
  """
420
476
  Return the smallest rectangle that fully contains the circle.
421
477
  """
422
- def collide_circle(self, circle: Circle) -> bool:
423
- """
424
- Check collision with another circle.
425
-
426
- Args:
427
- circle (Circle): The circle to test.
428
- """
429
- def collide_line(self, line: Line) -> bool:
430
- """
431
- Check collision with a line.
432
-
433
- Args:
434
- line (Line): The line to test.
435
- """
436
- def collide_point(self, point: Vec2) -> bool:
437
- """
438
- Check if a point lies inside the circle.
439
-
440
- Args:
441
- point (Vec2): The point to test.
442
- """
443
- def collide_rect(self, rect: Rect) -> bool:
444
- """
445
- Check collision with a rectangle.
446
-
447
- Args:
448
- rect (Rect): The rectangle to test.
449
- """
450
- def contains(self, shape: typing.Any) -> bool:
451
- """
452
- Check if the circle fully contains the given shape.
453
-
454
- Args:
455
- shape (Vec2, Circle, or Rect): The shape to test.
456
- """
457
478
  def copy(self) -> Circle:
458
479
  """
459
480
  Return a copy of the circle.
@@ -494,28 +515,9 @@ class Color:
494
515
  """
495
516
  __hash__: typing.ClassVar[None] = None
496
517
  def __eq__(self, other: Color) -> bool:
497
- """
498
- Check if two Color objects are equal (all RGBA components match).
499
-
500
- Args:
501
- other (Color): The color to compare with.
502
-
503
- Returns:
504
- bool: True if colors are identical, False otherwise.
505
- """
518
+ ...
506
519
  def __getitem__(self, index: typing.SupportsInt) -> int:
507
- """
508
- Access color channels by index.
509
-
510
- Args:
511
- index (int): Channel index (0=r, 1=g, 2=b, 3=a).
512
-
513
- Returns:
514
- int: Channel value (0-255).
515
-
516
- Raises:
517
- IndexError: If index is not in range [0, 3].
518
- """
520
+ ...
519
521
  @typing.overload
520
522
  def __init__(self) -> None:
521
523
  """
@@ -533,68 +535,43 @@ class Color:
533
535
  a (int, optional): Alpha value [0-255]. Defaults to 255.
534
536
  """
535
537
  @typing.overload
536
- def __init__(self, arg0: typing.Any) -> None:
538
+ def __init__(self, hex: str) -> None:
537
539
  """
538
- Create a Color from a hex string or a sequence of RGB(A) integers.
540
+ Create a Color from a hex string.
539
541
 
540
- Examples:
541
- Color("#ff00ff")
542
- Color([255, 0, 255])
543
- Color((255, 0, 255, 128))
542
+ Args:
543
+ hex (str): Hex color string (with or without '#' prefix).
544
544
  """
545
- def __iter__(self) -> collections.abc.Iterator:
545
+ @typing.overload
546
+ def __init__(self, sequence: collections.abc.Sequence) -> None:
546
547
  """
547
- Return an iterator over color channels.
548
-
549
- Yields:
550
- int: The r, g, b, a values in that order (0-255 each).
548
+ Create a Color from a sequence of RGB(A) integers.
551
549
 
552
- Example:
553
- for channel in color:
554
- print(channel) # Prints r, g, b, a values
550
+ Args:
551
+ sequence (list or tuple): A sequence of 3 or 4 integers [0-255].
552
+ - 3 values: RGB (alpha defaults to 255)
553
+ - 4 values: RGBA
555
554
  """
555
+ def __iter__(self) -> collections.abc.Iterator:
556
+ ...
556
557
  def __len__(self) -> int:
557
- """
558
- Return the number of color channels.
559
-
560
- Returns:
561
- int: Always returns 4 (for r, g, b, a channels).
562
- """
558
+ ...
559
+ def __mul__(self, scalar: typing.SupportsFloat) -> Color:
560
+ ...
563
561
  def __ne__(self, other: Color) -> bool:
564
- """
565
- Check if two Color objects are not equal.
566
-
567
- Args:
568
- other (Color): The color to compare with.
569
-
570
- Returns:
571
- bool: True if any component differs, False otherwise.
572
- """
562
+ ...
563
+ def __neg__(self) -> Color:
564
+ ...
573
565
  def __repr__(self) -> str:
574
- """
575
- Return a string suitable for debugging and recreation.
576
-
577
- Returns:
578
- str: String in format "Color(r, g, b, a)" that can recreate the object.
579
- """
566
+ ...
567
+ def __rmul__(self, scalar: typing.SupportsFloat) -> Color:
568
+ ...
580
569
  def __setitem__(self, index: typing.SupportsInt, value: typing.SupportsInt) -> None:
581
- """
582
- Set a color channel by index.
583
-
584
- Args:
585
- index (int): Channel index (0=r, 1=g, 2=b, 3=a).
586
- value (int): New channel value (0-255).
587
-
588
- Raises:
589
- IndexError: If index is not in range [0, 3].
590
- """
570
+ ...
591
571
  def __str__(self) -> str:
592
- """
593
- Return a human-readable string representation.
594
-
595
- Returns:
596
- str: String in format "(r, g, b, a)" with integer values.
597
- """
572
+ ...
573
+ def __truediv__(self, scalar: typing.SupportsFloat) -> Color:
574
+ ...
598
575
  def copy(self) -> Color:
599
576
  """
600
577
  Create a copy of the color.
@@ -740,17 +717,7 @@ class Event:
740
717
 
741
718
  """
742
719
  def __getattr__(self, arg0: str) -> typing.Any:
743
- """
744
- Dynamically access event attributes.
745
-
746
- Examples:
747
- event.key
748
- event.button
749
- event.pos
750
-
751
- Raises:
752
- AttributeError: If the requested attribute doesn't exist.
753
- """
720
+ ...
754
721
  @property
755
722
  def type(self) -> int:
756
723
  """
@@ -760,27 +727,48 @@ class EventType(enum.IntEnum):
760
727
  AUDIO_DEVICE_ADDED: typing.ClassVar[EventType] # value = <EventType.AUDIO_DEVICE_ADDED: 4352>
761
728
  AUDIO_DEVICE_FORMAT_CHANGED: typing.ClassVar[EventType] # value = <EventType.AUDIO_DEVICE_FORMAT_CHANGED: 4354>
762
729
  AUDIO_DEVICE_REMOVED: typing.ClassVar[EventType] # value = <EventType.AUDIO_DEVICE_REMOVED: 4353>
763
- CAMERA_ADDED: typing.ClassVar[EventType] # value = <EventType.CAMERA_ADDED: 5120>
764
- CAMERA_APPROVED: typing.ClassVar[EventType] # value = <EventType.CAMERA_APPROVED: 5122>
765
- CAMERA_DENIED: typing.ClassVar[EventType] # value = <EventType.CAMERA_DENIED: 5123>
766
- CAMERA_REMOVED: typing.ClassVar[EventType] # value = <EventType.CAMERA_REMOVED: 5121>
730
+ CAMERA_DEVICE_ADDED: typing.ClassVar[EventType] # value = <EventType.CAMERA_DEVICE_ADDED: 5120>
731
+ CAMERA_DEVICE_APPROVED: typing.ClassVar[EventType] # value = <EventType.CAMERA_DEVICE_APPROVED: 5122>
732
+ CAMERA_DEVICE_DENIED: typing.ClassVar[EventType] # value = <EventType.CAMERA_DEVICE_DENIED: 5123>
733
+ CAMERA_DEVICE_REMOVED: typing.ClassVar[EventType] # value = <EventType.CAMERA_DEVICE_REMOVED: 5121>
734
+ CLIPBOARD_UPDATE: typing.ClassVar[EventType] # value = <EventType.CLIPBOARD_UPDATE: 2304>
735
+ DID_ENTER_BACKGROUND: typing.ClassVar[EventType] # value = <EventType.DID_ENTER_BACKGROUND: 260>
736
+ DID_ENTER_FOREGROUND: typing.ClassVar[EventType] # value = <EventType.DID_ENTER_FOREGROUND: 262>
737
+ DISPLAY_ADDED: typing.ClassVar[EventType] # value = <EventType.DISPLAY_ADDED: 338>
738
+ DISPLAY_CONTENT_SCALE_CHANGED: typing.ClassVar[EventType] # value = <EventType.DISPLAY_CONTENT_SCALE_CHANGED: 343>
739
+ DISPLAY_CURRENT_MODE_CHANGED: typing.ClassVar[EventType] # value = <EventType.DISPLAY_CURRENT_MODE_CHANGED: 342>
740
+ DISPLAY_DESKTOP_MODE_CHANGED: typing.ClassVar[EventType] # value = <EventType.DISPLAY_DESKTOP_MODE_CHANGED: 341>
741
+ DISPLAY_MOVED: typing.ClassVar[EventType] # value = <EventType.DISPLAY_MOVED: 340>
742
+ DISPLAY_ORIENTATION: typing.ClassVar[EventType] # value = <EventType.DISPLAY_ORIENTATION: 337>
743
+ DISPLAY_REMOVED: typing.ClassVar[EventType] # value = <EventType.DISPLAY_REMOVED: 339>
767
744
  DROP_BEGIN: typing.ClassVar[EventType] # value = <EventType.DROP_BEGIN: 4098>
768
745
  DROP_COMPLETE: typing.ClassVar[EventType] # value = <EventType.DROP_COMPLETE: 4099>
769
746
  DROP_FILE: typing.ClassVar[EventType] # value = <EventType.DROP_FILE: 4096>
770
747
  DROP_POSITION: typing.ClassVar[EventType] # value = <EventType.DROP_POSITION: 4100>
771
748
  DROP_TEXT: typing.ClassVar[EventType] # value = <EventType.DROP_TEXT: 4097>
749
+ FINGER_CANCELED: typing.ClassVar[EventType] # value = <EventType.FINGER_CANCELED: 1795>
750
+ FINGER_DOWN: typing.ClassVar[EventType] # value = <EventType.FINGER_DOWN: 1792>
751
+ FINGER_MOTION: typing.ClassVar[EventType] # value = <EventType.FINGER_MOTION: 1794>
752
+ FINGER_UP: typing.ClassVar[EventType] # value = <EventType.FINGER_UP: 1793>
772
753
  GAMEPAD_ADDED: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_ADDED: 1619>
773
754
  GAMEPAD_AXIS_MOTION: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_AXIS_MOTION: 1616>
774
755
  GAMEPAD_BUTTON_DOWN: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_BUTTON_DOWN: 1617>
775
756
  GAMEPAD_BUTTON_UP: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_BUTTON_UP: 1618>
757
+ GAMEPAD_REMAPPED: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_REMAPPED: 1621>
776
758
  GAMEPAD_REMOVED: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_REMOVED: 1620>
759
+ GAMEPAD_SENSOR_UPDATE: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_SENSOR_UPDATE: 1625>
760
+ GAMEPAD_STEAM_HANDLE_UPDATED: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_STEAM_HANDLE_UPDATED: 1627>
777
761
  GAMEPAD_TOUCHPAD_DOWN: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_TOUCHPAD_DOWN: 1622>
778
762
  GAMEPAD_TOUCHPAD_MOTION: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_TOUCHPAD_MOTION: 1623>
779
763
  GAMEPAD_TOUCHPAD_UP: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_TOUCHPAD_UP: 1624>
764
+ GAMEPAD_UPDATE_COMPLETE: typing.ClassVar[EventType] # value = <EventType.GAMEPAD_UPDATE_COMPLETE: 1626>
780
765
  KEYBOARD_ADDED: typing.ClassVar[EventType] # value = <EventType.KEYBOARD_ADDED: 773>
781
766
  KEYBOARD_REMOVED: typing.ClassVar[EventType] # value = <EventType.KEYBOARD_REMOVED: 774>
767
+ KEYMAP_CHANGED: typing.ClassVar[EventType] # value = <EventType.KEYMAP_CHANGED: 772>
782
768
  KEY_DOWN: typing.ClassVar[EventType] # value = <EventType.KEY_DOWN: 768>
783
769
  KEY_UP: typing.ClassVar[EventType] # value = <EventType.KEY_UP: 769>
770
+ LOCALE_CHANGED: typing.ClassVar[EventType] # value = <EventType.LOCALE_CHANGED: 263>
771
+ LOW_MEMORY: typing.ClassVar[EventType] # value = <EventType.LOW_MEMORY: 258>
784
772
  MOUSE_ADDED: typing.ClassVar[EventType] # value = <EventType.MOUSE_ADDED: 1028>
785
773
  MOUSE_BUTTON_DOWN: typing.ClassVar[EventType] # value = <EventType.MOUSE_BUTTON_DOWN: 1025>
786
774
  MOUSE_BUTTON_UP: typing.ClassVar[EventType] # value = <EventType.MOUSE_BUTTON_UP: 1026>
@@ -796,13 +784,29 @@ class EventType(enum.IntEnum):
796
784
  PEN_PROXIMITY_OUT: typing.ClassVar[EventType] # value = <EventType.PEN_PROXIMITY_OUT: 4865>
797
785
  PEN_UP: typing.ClassVar[EventType] # value = <EventType.PEN_UP: 4867>
798
786
  QUIT: typing.ClassVar[EventType] # value = <EventType.QUIT: 256>
787
+ RENDER_DEVICE_LOST: typing.ClassVar[EventType] # value = <EventType.RENDER_DEVICE_LOST: 8194>
788
+ RENDER_DEVICE_RESET: typing.ClassVar[EventType] # value = <EventType.RENDER_DEVICE_RESET: 8193>
789
+ RENDER_TARGETS_RESET: typing.ClassVar[EventType] # value = <EventType.RENDER_TARGETS_RESET: 8192>
790
+ SENSOR_UPDATE: typing.ClassVar[EventType] # value = <EventType.SENSOR_UPDATE: 4608>
791
+ SYSTEM_THEME_CHANGED: typing.ClassVar[EventType] # value = <EventType.SYSTEM_THEME_CHANGED: 264>
792
+ TERMINATING: typing.ClassVar[EventType] # value = <EventType.TERMINATING: 257>
799
793
  TEXT_EDITING: typing.ClassVar[EventType] # value = <EventType.TEXT_EDITING: 770>
794
+ TEXT_EDITING_CANDIDATES: typing.ClassVar[EventType] # value = <EventType.TEXT_EDITING_CANDIDATES: 775>
800
795
  TEXT_INPUT: typing.ClassVar[EventType] # value = <EventType.TEXT_INPUT: 771>
796
+ WILL_ENTER_BACKGROUND: typing.ClassVar[EventType] # value = <EventType.WILL_ENTER_BACKGROUND: 259>
797
+ WILL_ENTER_FOREGROUND: typing.ClassVar[EventType] # value = <EventType.WILL_ENTER_FOREGROUND: 261>
798
+ WINDOW_CLOSE_REQUESTED: typing.ClassVar[EventType] # value = <EventType.WINDOW_CLOSE_REQUESTED: 528>
799
+ WINDOW_DESTROYED: typing.ClassVar[EventType] # value = <EventType.WINDOW_DESTROYED: 537>
800
+ WINDOW_DISPLAY_CHANGED: typing.ClassVar[EventType] # value = <EventType.WINDOW_DISPLAY_CHANGED: 531>
801
+ WINDOW_DISPLAY_SCALE_CHANGED: typing.ClassVar[EventType] # value = <EventType.WINDOW_DISPLAY_SCALE_CHANGED: 532>
801
802
  WINDOW_ENTER_FULLSCREEN: typing.ClassVar[EventType] # value = <EventType.WINDOW_ENTER_FULLSCREEN: 535>
802
803
  WINDOW_EXPOSED: typing.ClassVar[EventType] # value = <EventType.WINDOW_EXPOSED: 516>
803
804
  WINDOW_FOCUS_GAINED: typing.ClassVar[EventType] # value = <EventType.WINDOW_FOCUS_GAINED: 526>
804
805
  WINDOW_FOCUS_LOST: typing.ClassVar[EventType] # value = <EventType.WINDOW_FOCUS_LOST: 527>
806
+ WINDOW_HDR_STATE_CHANGED: typing.ClassVar[EventType] # value = <EventType.WINDOW_HDR_STATE_CHANGED: 538>
805
807
  WINDOW_HIDDEN: typing.ClassVar[EventType] # value = <EventType.WINDOW_HIDDEN: 515>
808
+ WINDOW_HIT_TEST: typing.ClassVar[EventType] # value = <EventType.WINDOW_HIT_TEST: 529>
809
+ WINDOW_ICCPROF_CHANGED: typing.ClassVar[EventType] # value = <EventType.WINDOW_ICCPROF_CHANGED: 530>
806
810
  WINDOW_LEAVE_FULLSCREEN: typing.ClassVar[EventType] # value = <EventType.WINDOW_LEAVE_FULLSCREEN: 536>
807
811
  WINDOW_MAXIMIZED: typing.ClassVar[EventType] # value = <EventType.WINDOW_MAXIMIZED: 522>
808
812
  WINDOW_MINIMIZED: typing.ClassVar[EventType] # value = <EventType.WINDOW_MINIMIZED: 521>
@@ -812,6 +816,7 @@ class EventType(enum.IntEnum):
812
816
  WINDOW_OCCLUDED: typing.ClassVar[EventType] # value = <EventType.WINDOW_OCCLUDED: 534>
813
817
  WINDOW_RESIZED: typing.ClassVar[EventType] # value = <EventType.WINDOW_RESIZED: 518>
814
818
  WINDOW_RESTORED: typing.ClassVar[EventType] # value = <EventType.WINDOW_RESTORED: 523>
819
+ WINDOW_SAFE_AREA_CHANGED: typing.ClassVar[EventType] # value = <EventType.WINDOW_SAFE_AREA_CHANGED: 533>
815
820
  WINDOW_SHOWN: typing.ClassVar[EventType] # value = <EventType.WINDOW_SHOWN: 514>
816
821
  @classmethod
817
822
  def __new__(cls, value):
@@ -823,11 +828,11 @@ class EventType(enum.IntEnum):
823
828
  class Font:
824
829
  """
825
830
 
826
- A font object for rendering text to the active renderer.
831
+ A font typeface for rendering text.
827
832
 
828
- This class wraps an SDL_ttf font and an internal text object for efficient
829
- rendering. You can load fonts from a file path or use one of the built-in
830
- typefaces:
833
+ This class wraps an SDL_ttf font and manages font properties like size,
834
+ style, and alignment. You can load fonts from a file path or use one of
835
+ the built-in typefaces:
831
836
 
832
837
  - "kraken-clean": A clean sans-serif font bundled with the engine.
833
838
  - "kraken-retro": A pixel/retro font bundled with the engine. Point size is
@@ -838,7 +843,7 @@ class Font:
838
843
  call kn.window.create(...) first, which initializes the font engine.
839
844
 
840
845
  """
841
- def __init__(self, arg0: str, arg1: typing.SupportsInt) -> None:
846
+ def __init__(self, file_dir: str, pt_size: typing.SupportsInt) -> None:
842
847
  """
843
848
  Create a Font.
844
849
 
@@ -852,69 +857,135 @@ class Font:
852
857
  Raises:
853
858
  RuntimeError: If the font fails to load.
854
859
  """
855
- def draw(self, text: str, pos: typing.Any = None, color: typing.Any = None, wrap_width: typing.SupportsInt = 0) -> None:
860
+ @property
861
+ def alignment(self) -> Align:
856
862
  """
857
- Draw text to the renderer.
858
-
859
- Args:
860
- text (str): The text to render.
861
- pos (Vec2 | None, optional): The position in pixels. Defaults to (0, 0).
862
- color (Color | None, optional): Text color. Defaults to white.
863
- wrap_width (int, optional): Wrap the text at this pixel width. Set to 0 for
864
- no wrapping. Defaults to 0.
863
+ Get or set the text alignment for wrapped text.
865
864
 
866
- Returns:
867
- None
865
+ Valid values: Align.LEFT, Align.CENTER, Align.RIGHT
868
866
  """
869
- def set_bold(self, on: bool) -> None:
867
+ @alignment.setter
868
+ def alignment(self, arg1: Align) -> None:
869
+ ...
870
+ @property
871
+ def ascent(self) -> int:
870
872
  """
871
- Enable or disable bold text style.
872
-
873
- Args:
874
- on (bool): True to enable bold, False to disable.
873
+ Get the pixel ascent of the font.
875
874
 
876
875
  Returns:
877
- None
876
+ int: The font ascent in pixels.
878
877
  """
879
- def set_italic(self, on: bool) -> None:
878
+ @property
879
+ def bold(self) -> bool:
880
880
  """
881
- Enable or disable italic text style.
882
-
883
- Args:
884
- on (bool): True to enable italic, False to disable.
885
-
886
- Returns:
887
- None
881
+ Get or set whether bold text style is enabled.
888
882
  """
889
- def set_pt_size(self, pt: typing.SupportsInt) -> None:
883
+ @bold.setter
884
+ def bold(self, arg1: bool) -> None:
885
+ ...
886
+ @property
887
+ def descent(self) -> int:
890
888
  """
891
- Set the font point size.
892
-
893
- Args:
894
- pt (int): The new point size. Values below 8 are clamped to 8.
889
+ Get the pixel descent of the font.
895
890
 
896
891
  Returns:
897
- None
892
+ int: The font descent in pixels.
898
893
  """
899
- def set_strikethrough(self, on: bool) -> None:
894
+ @property
895
+ def height(self) -> int:
900
896
  """
901
- Enable or disable strikethrough text style.
902
-
903
- Args:
904
- on (bool): True to enable strikethrough, False to disable.
897
+ Get the maximum pixel height of all glyphs in the font.
905
898
 
906
899
  Returns:
907
- None
900
+ int: The font height in pixels.
908
901
  """
909
- def set_underline(self, on: bool) -> None:
902
+ @property
903
+ def hinting(self) -> FontHint:
910
904
  """
911
- Enable or disable underline text style.
905
+ Get or set the font hinting mode.
912
906
 
913
- Args:
914
- on (bool): True to enable underline, False to disable.
907
+ Valid values: FontHinting.NORMAL, FontHinting.MONO, FontHinting.LIGHT,
908
+ FontHinting.LIGHT_SUBPIXEL, FontHinting.NONE
909
+ """
910
+ @hinting.setter
911
+ def hinting(self, arg1: FontHint) -> None:
912
+ ...
913
+ @property
914
+ def italic(self) -> bool:
915
+ """
916
+ Get or set whether italic text style is enabled.
917
+ """
918
+ @italic.setter
919
+ def italic(self, arg1: bool) -> None:
920
+ ...
921
+ @property
922
+ def kerning(self) -> bool:
923
+ """
924
+ Get or set whether kerning is enabled.
925
+ """
926
+ @kerning.setter
927
+ def kerning(self, arg1: bool) -> None:
928
+ ...
929
+ @property
930
+ def line_spacing(self) -> int:
931
+ """
932
+ Get or set the spacing between lines of text in pixels.
933
+ """
934
+ @line_spacing.setter
935
+ def line_spacing(self, arg1: typing.SupportsInt) -> None:
936
+ ...
937
+ @property
938
+ def outline(self) -> int:
939
+ """
940
+ Get or set the outline width in pixels (0 for no outline).
941
+ """
942
+ @outline.setter
943
+ def outline(self, arg1: typing.SupportsInt) -> None:
944
+ ...
945
+ @property
946
+ def pt_size(self) -> int:
947
+ """
948
+ Get or set the point size of the font. Values below 8 are clamped to 8.
949
+ """
950
+ @pt_size.setter
951
+ def pt_size(self, arg1: typing.SupportsInt) -> None:
952
+ ...
953
+ @property
954
+ def strikethrough(self) -> bool:
955
+ """
956
+ Get or set whether strikethrough text style is enabled.
957
+ """
958
+ @strikethrough.setter
959
+ def strikethrough(self, arg1: bool) -> None:
960
+ ...
961
+ @property
962
+ def underline(self) -> bool:
963
+ """
964
+ Get or set whether underline text style is enabled.
965
+ """
966
+ @underline.setter
967
+ def underline(self, arg1: bool) -> None:
968
+ ...
969
+ class FontHint(enum.IntEnum):
970
+ """
971
+
972
+ Font hinting modes for controlling how fonts are rendered.
973
+
974
+ Hinting is the process of fitting font outlines to the pixel grid to improve
975
+ readability at small sizes.
915
976
 
916
- Returns:
917
- None
977
+ """
978
+ LIGHT: typing.ClassVar[FontHint] # value = <FontHint.LIGHT: 2>
979
+ LIGHT_SUBPIXEL: typing.ClassVar[FontHint] # value = <FontHint.LIGHT_SUBPIXEL: 3>
980
+ MONO: typing.ClassVar[FontHint] # value = <FontHint.MONO: 1>
981
+ NONE: typing.ClassVar[FontHint] # value = <FontHint.NONE: 4>
982
+ NORMAL: typing.ClassVar[FontHint] # value = <FontHint.NORMAL: 0>
983
+ @classmethod
984
+ def __new__(cls, value):
985
+ ...
986
+ def __format__(self, format_spec):
987
+ """
988
+ Convert to a string according to format_spec.
918
989
  """
919
990
  class Frame:
920
991
  """
@@ -1052,12 +1123,16 @@ class Keycode(enum.IntEnum):
1052
1123
  K_9: typing.ClassVar[Keycode] # value = <Keycode.K_9: 57>
1053
1124
  K_AGAIN: typing.ClassVar[Keycode] # value = <Keycode.K_AGAIN: 1073741945>
1054
1125
  K_AMPERSAND: typing.ClassVar[Keycode] # value = <Keycode.K_AMPERSAND: 38>
1126
+ K_APPLICATION: typing.ClassVar[Keycode] # value = <Keycode.K_APPLICATION: 1073741925>
1055
1127
  K_ASTERISK: typing.ClassVar[Keycode] # value = <Keycode.K_ASTERISK: 42>
1056
1128
  K_AT: typing.ClassVar[Keycode] # value = <Keycode.K_AT: 64>
1057
1129
  K_BACKSLASH: typing.ClassVar[Keycode] # value = <Keycode.K_BACKSLASH: 92>
1058
1130
  K_BACKSPACE: typing.ClassVar[Keycode] # value = <Keycode.K_BACKSPACE: 8>
1131
+ K_CALL: typing.ClassVar[Keycode] # value = <Keycode.K_CALL: 1073742113>
1059
1132
  K_CAPS: typing.ClassVar[Keycode] # value = <Keycode.K_CAPS: 1073741881>
1060
1133
  K_CARET: typing.ClassVar[Keycode] # value = <Keycode.K_CARET: 94>
1134
+ K_CHANNEL_DEC: typing.ClassVar[Keycode] # value = <Keycode.K_CHANNEL_DEC: 1073742085>
1135
+ K_CHANNEL_INC: typing.ClassVar[Keycode] # value = <Keycode.K_CHANNEL_INC: 1073742084>
1061
1136
  K_COLON: typing.ClassVar[Keycode] # value = <Keycode.K_COLON: 58>
1062
1137
  K_COMMA: typing.ClassVar[Keycode] # value = <Keycode.K_COMMA: 44>
1063
1138
  K_COPY: typing.ClassVar[Keycode] # value = <Keycode.K_COPY: 1073741948>
@@ -1067,13 +1142,18 @@ class Keycode(enum.IntEnum):
1067
1142
  K_DOLLAR: typing.ClassVar[Keycode] # value = <Keycode.K_DOLLAR: 36>
1068
1143
  K_DOWN: typing.ClassVar[Keycode] # value = <Keycode.K_DOWN: 1073741905>
1069
1144
  K_END: typing.ClassVar[Keycode] # value = <Keycode.K_END: 1073741901>
1145
+ K_ENDCALL: typing.ClassVar[Keycode] # value = <Keycode.K_ENDCALL: 1073742114>
1070
1146
  K_EQ: typing.ClassVar[Keycode] # value = <Keycode.K_EQ: 61>
1071
1147
  K_ESC: typing.ClassVar[Keycode] # value = <Keycode.K_ESC: 27>
1072
1148
  K_EXCLAIM: typing.ClassVar[Keycode] # value = <Keycode.K_EXCLAIM: 33>
1149
+ K_EXECUTE: typing.ClassVar[Keycode] # value = <Keycode.K_EXECUTE: 1073741940>
1073
1150
  K_F1: typing.ClassVar[Keycode] # value = <Keycode.K_F1: 1073741882>
1074
1151
  K_F10: typing.ClassVar[Keycode] # value = <Keycode.K_F10: 1073741891>
1075
1152
  K_F11: typing.ClassVar[Keycode] # value = <Keycode.K_F11: 1073741892>
1076
1153
  K_F12: typing.ClassVar[Keycode] # value = <Keycode.K_F12: 1073741893>
1154
+ K_F13: typing.ClassVar[Keycode] # value = <Keycode.K_F13: 1073741928>
1155
+ K_F14: typing.ClassVar[Keycode] # value = <Keycode.K_F14: 1073741929>
1156
+ K_F15: typing.ClassVar[Keycode] # value = <Keycode.K_F15: 1073741930>
1077
1157
  K_F2: typing.ClassVar[Keycode] # value = <Keycode.K_F2: 1073741883>
1078
1158
  K_F3: typing.ClassVar[Keycode] # value = <Keycode.K_F3: 1073741884>
1079
1159
  K_F4: typing.ClassVar[Keycode] # value = <Keycode.K_F4: 1073741885>
@@ -1086,6 +1166,7 @@ class Keycode(enum.IntEnum):
1086
1166
  K_GRAVE: typing.ClassVar[Keycode] # value = <Keycode.K_GRAVE: 96>
1087
1167
  K_GT: typing.ClassVar[Keycode] # value = <Keycode.K_GT: 62>
1088
1168
  K_HASH: typing.ClassVar[Keycode] # value = <Keycode.K_HASH: 35>
1169
+ K_HELP: typing.ClassVar[Keycode] # value = <Keycode.K_HELP: 1073741941>
1089
1170
  K_HOME: typing.ClassVar[Keycode] # value = <Keycode.K_HOME: 1073741898>
1090
1171
  K_INS: typing.ClassVar[Keycode] # value = <Keycode.K_INS: 1073741897>
1091
1172
  K_KP_0: typing.ClassVar[Keycode] # value = <Keycode.K_KP_0: 1073741922>
@@ -1113,7 +1194,20 @@ class Keycode(enum.IntEnum):
1113
1194
  K_LPAREN: typing.ClassVar[Keycode] # value = <Keycode.K_LPAREN: 40>
1114
1195
  K_LSHIFT: typing.ClassVar[Keycode] # value = <Keycode.K_LSHIFT: 1073742049>
1115
1196
  K_LT: typing.ClassVar[Keycode] # value = <Keycode.K_LT: 60>
1197
+ K_MEDIA_EJECT: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_EJECT: 1073742094>
1198
+ K_MEDIA_FF: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_FF: 1073742089>
1199
+ K_MEDIA_NEXT: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_NEXT: 1073742091>
1200
+ K_MEDIA_PAUSE: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_PAUSE: 1073742087>
1201
+ K_MEDIA_PLAY: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_PLAY: 1073742086>
1202
+ K_MEDIA_PLAY_PAUSE: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_PLAY_PAUSE: 1073742095>
1203
+ K_MEDIA_PREV: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_PREV: 1073742092>
1204
+ K_MEDIA_REC: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_REC: 1073742088>
1205
+ K_MEDIA_REWIND: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_REWIND: 1073742090>
1206
+ K_MEDIA_SELECT: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_SELECT: 1073742096>
1207
+ K_MEDIA_STOP: typing.ClassVar[Keycode] # value = <Keycode.K_MEDIA_STOP: 1073742093>
1208
+ K_MENU: typing.ClassVar[Keycode] # value = <Keycode.K_MENU: 1073741942>
1116
1209
  K_MINUS: typing.ClassVar[Keycode] # value = <Keycode.K_MINUS: 45>
1210
+ K_MODE: typing.ClassVar[Keycode] # value = <Keycode.K_MODE: 1073742081>
1117
1211
  K_MUTE: typing.ClassVar[Keycode] # value = <Keycode.K_MUTE: 1073741951>
1118
1212
  K_NUMLOCK: typing.ClassVar[Keycode] # value = <Keycode.K_NUMLOCK: 1073741907>
1119
1213
  K_PASTE: typing.ClassVar[Keycode] # value = <Keycode.K_PASTE: 1073741949>
@@ -1124,6 +1218,7 @@ class Keycode(enum.IntEnum):
1124
1218
  K_PGUP: typing.ClassVar[Keycode] # value = <Keycode.K_PGUP: 1073741899>
1125
1219
  K_PIPE: typing.ClassVar[Keycode] # value = <Keycode.K_PIPE: 124>
1126
1220
  K_PLUS: typing.ClassVar[Keycode] # value = <Keycode.K_PLUS: 43>
1221
+ K_POWER: typing.ClassVar[Keycode] # value = <Keycode.K_POWER: 1073741926>
1127
1222
  K_PRTSCR: typing.ClassVar[Keycode] # value = <Keycode.K_PRTSCR: 1073741894>
1128
1223
  K_QUESTION: typing.ClassVar[Keycode] # value = <Keycode.K_QUESTION: 63>
1129
1224
  K_RALT: typing.ClassVar[Keycode] # value = <Keycode.K_RALT: 1073742054>
@@ -1136,17 +1231,24 @@ class Keycode(enum.IntEnum):
1136
1231
  K_RPAREN: typing.ClassVar[Keycode] # value = <Keycode.K_RPAREN: 41>
1137
1232
  K_RSHIFT: typing.ClassVar[Keycode] # value = <Keycode.K_RSHIFT: 1073742053>
1138
1233
  K_SCRLK: typing.ClassVar[Keycode] # value = <Keycode.K_SCRLK: 1073741895>
1234
+ K_SELECT: typing.ClassVar[Keycode] # value = <Keycode.K_SELECT: 1073741943>
1139
1235
  K_SEMICOLON: typing.ClassVar[Keycode] # value = <Keycode.K_SEMICOLON: 59>
1140
1236
  K_SGLQUOTE: typing.ClassVar[Keycode] # value = <Keycode.K_SGLQUOTE: 39>
1141
1237
  K_SLASH: typing.ClassVar[Keycode] # value = <Keycode.K_SLASH: 47>
1238
+ K_SLEEP: typing.ClassVar[Keycode] # value = <Keycode.K_SLEEP: 1073742082>
1239
+ K_SOFTLEFT: typing.ClassVar[Keycode] # value = <Keycode.K_SOFTLEFT: 1073742111>
1240
+ K_SOFTRIGHT: typing.ClassVar[Keycode] # value = <Keycode.K_SOFTRIGHT: 1073742112>
1142
1241
  K_SPACE: typing.ClassVar[Keycode] # value = <Keycode.K_SPACE: 32>
1242
+ K_STOP: typing.ClassVar[Keycode] # value = <Keycode.K_STOP: 1073741944>
1143
1243
  K_TAB: typing.ClassVar[Keycode] # value = <Keycode.K_TAB: 9>
1144
1244
  K_TILDE: typing.ClassVar[Keycode] # value = <Keycode.K_TILDE: 126>
1145
1245
  K_UNDERSCORE: typing.ClassVar[Keycode] # value = <Keycode.K_UNDERSCORE: 95>
1146
1246
  K_UNDO: typing.ClassVar[Keycode] # value = <Keycode.K_UNDO: 1073741946>
1247
+ K_UNKNOWN: typing.ClassVar[Keycode] # value = <Keycode.K_UNKNOWN: 0>
1147
1248
  K_UP: typing.ClassVar[Keycode] # value = <Keycode.K_UP: 1073741906>
1148
1249
  K_VOLDOWN: typing.ClassVar[Keycode] # value = <Keycode.K_VOLDOWN: 1073741953>
1149
1250
  K_VOLUP: typing.ClassVar[Keycode] # value = <Keycode.K_VOLUP: 1073741952>
1251
+ K_WAKE: typing.ClassVar[Keycode] # value = <Keycode.K_WAKE: 1073742083>
1150
1252
  K_a: typing.ClassVar[Keycode] # value = <Keycode.K_a: 97>
1151
1253
  K_b: typing.ClassVar[Keycode] # value = <Keycode.K_b: 98>
1152
1254
  K_c: typing.ClassVar[Keycode] # value = <Keycode.K_c: 99>
@@ -1180,99 +1282,36 @@ class Keycode(enum.IntEnum):
1180
1282
  """
1181
1283
  Convert to a string according to format_spec.
1182
1284
  """
1183
- class Layer:
1285
+ class Line:
1184
1286
  """
1185
1287
 
1186
- A layer within a tile map.
1187
-
1188
- Layers can be either tile layers or object layers and contain a list of tiles.
1288
+ A 2D line segment defined by two points: A and B.
1289
+ You can access or modify points using `.a`, `.b`, or directly via `.ax`, `.ay`, `.bx`, `.by`.
1189
1290
 
1190
1291
  """
1191
- class Type(enum.IntEnum):
1292
+ __hash__: typing.ClassVar[None] = None
1293
+ def __eq__(self, other: Line) -> bool:
1294
+ ...
1295
+ def __getitem__(self, index: typing.SupportsInt) -> float:
1296
+ ...
1297
+ @typing.overload
1298
+ def __init__(self) -> None:
1192
1299
  """
1193
-
1194
- The type of a Layer.
1195
-
1300
+ Create a default line with all values set to 0.
1196
1301
  """
1197
- OBJECT: typing.ClassVar[Layer.Type] # value = <Type.OBJECT: 0>
1198
- TILE: typing.ClassVar[Layer.Type] # value = <Type.TILE: 1>
1199
- @classmethod
1200
- def __new__(cls, value):
1201
- ...
1202
- def __format__(self, format_spec):
1203
- """
1204
- Convert to a string according to format_spec.
1205
- """
1206
- OBJECT: typing.ClassVar[Layer.Type] # value = <Type.OBJECT: 0>
1207
- TILE: typing.ClassVar[Layer.Type] # value = <Type.TILE: 1>
1208
- def render(self) -> None:
1302
+ @typing.overload
1303
+ def __init__(self, ax: typing.SupportsFloat, ay: typing.SupportsFloat, bx: typing.SupportsFloat, by: typing.SupportsFloat) -> None:
1209
1304
  """
1210
- Render the layer.
1305
+ Create a line from two coordinate points.
1306
+
1307
+ Args:
1308
+ ax (float): X-coordinate of point A.
1309
+ ay (float): Y-coordinate of point A.
1310
+ bx (float): X-coordinate of point B.
1311
+ by (float): Y-coordinate of point B.
1211
1312
  """
1212
- @property
1213
- def is_visible(self) -> bool:
1214
- """
1215
- Whether the layer is visible.
1216
- """
1217
- @property
1218
- def name(self) -> str:
1219
- """
1220
- The name of the layer.
1221
- """
1222
- @property
1223
- def tiles(self) -> list[Tile]:
1224
- """
1225
- The list of Tile instances contained in this layer.
1226
- """
1227
- @property
1228
- def type(self) -> Layer.Type:
1229
- """
1230
- The layer type (OBJECT or TILE).
1231
- """
1232
- class Line:
1233
- """
1234
-
1235
- A 2D line segment defined by two points: A and B.
1236
- You can access or modify points using `.a`, `.b`, or directly via `.ax`, `.ay`, `.bx`, `.by`.
1237
-
1238
- """
1239
- __hash__: typing.ClassVar[None] = None
1240
- def __eq__(self, other: Line) -> bool:
1241
- """
1242
- Check if two lines are equal.
1243
-
1244
- Args:
1245
- other (Line): The other line to compare.
1246
-
1247
- Returns:
1248
- bool: True if all components are equal.
1249
- """
1250
- def __getitem__(self, arg0: typing.SupportsInt) -> float:
1251
- """
1252
- Get coordinate by index:
1253
- 0 = ax, 1 = ay, 2 = bx, 3 = by
1254
-
1255
- Raises:
1256
- IndexError: If index is not 0-3.
1257
- """
1258
- @typing.overload
1259
- def __init__(self) -> None:
1260
- """
1261
- Create a default line with all values set to 0.
1262
- """
1263
- @typing.overload
1264
- def __init__(self, ax: typing.SupportsFloat, ay: typing.SupportsFloat, bx: typing.SupportsFloat, by: typing.SupportsFloat) -> None:
1265
- """
1266
- Create a line from two coordinate points.
1267
-
1268
- Args:
1269
- ax (float): X-coordinate of point A.
1270
- ay (float): Y-coordinate of point A.
1271
- bx (float): X-coordinate of point B.
1272
- by (float): Y-coordinate of point B.
1273
- """
1274
- @typing.overload
1275
- def __init__(self, ax: typing.SupportsFloat, ay: typing.SupportsFloat, b: Vec2) -> None:
1313
+ @typing.overload
1314
+ def __init__(self, ax: typing.SupportsFloat, ay: typing.SupportsFloat, b: Vec2) -> None:
1276
1315
  """
1277
1316
  Create a line from A coordinates and a Vec2 B point.
1278
1317
 
@@ -1311,22 +1350,9 @@ class Line:
1311
1350
  def __iter__(self) -> collections.abc.Iterator:
1312
1351
  ...
1313
1352
  def __len__(self) -> int:
1314
- """
1315
- Return the number of components (always 4).
1316
-
1317
- Returns:
1318
- int: Always returns 4 (ax, ay, bx, by).
1319
- """
1353
+ ...
1320
1354
  def __ne__(self, other: Line) -> bool:
1321
- """
1322
- Check if two lines are not equal.
1323
-
1324
- Args:
1325
- other (Line): The other line to compare.
1326
-
1327
- Returns:
1328
- bool: True if any component differs.
1329
- """
1355
+ ...
1330
1356
  def copy(self) -> Line:
1331
1357
  """
1332
1358
  Return a copy of this line.
@@ -1797,122 +1823,65 @@ class PixelArray:
1797
1823
  class PolarCoordinate:
1798
1824
  """
1799
1825
 
1800
- Represents a polar coordinate with angle and radius components.
1826
+ PolarCoordinate models a polar coordinate pair.
1801
1827
 
1802
- A polar coordinate system uses an angle (in radians) and radius to define a position
1803
- relative to a fixed origin point.
1804
-
1828
+ Attributes:
1829
+ angle (float): Angle in radians.
1830
+ radius (float): Distance from origin.
1831
+
1832
+ Methods:
1833
+ to_cartesian: Convert the coordinate to a Vec2.
1834
+
1805
1835
  """
1806
1836
  def __eq__(self, arg0: PolarCoordinate) -> bool:
1807
- """
1808
- Check if two PolarCoordinates are equal.
1809
-
1810
- Args:
1811
- other (PolarCoordinate): The other PolarCoordinate to compare.
1812
-
1813
- Returns:
1814
- bool: True if both angle and radius are equal.
1815
- """
1837
+ ...
1816
1838
  def __getitem__(self, index: typing.SupportsInt) -> float:
1817
- """
1818
- Access polar coordinate components by index.
1819
-
1820
- Args:
1821
- index (int): Index (0=angle, 1=radius).
1822
-
1823
- Returns:
1824
- float: The component value.
1825
-
1826
- Raises:
1827
- IndexError: If index is not 0 or 1.
1828
- """
1839
+ ...
1829
1840
  def __hash__(self) -> int:
1830
- """
1831
- Return a hash value for the PolarCoordinate.
1832
-
1833
- Returns:
1834
- int: Hash value based on angle and radius.
1835
- """
1841
+ ...
1836
1842
  @typing.overload
1837
1843
  def __init__(self) -> None:
1838
1844
  """
1839
- Create a PolarCoordinate with default values (0.0, 0.0).
1845
+ Initialize a PolarCoordinate with zero angle and radius.
1840
1846
  """
1841
1847
  @typing.overload
1842
1848
  def __init__(self, angle: typing.SupportsFloat, radius: typing.SupportsFloat) -> None:
1843
1849
  """
1844
- Create a PolarCoordinate from angle and radius.
1850
+ Initialize a PolarCoordinate from explicit values.
1845
1851
 
1846
1852
  Args:
1847
- angle (float): The angle in radians.
1848
- radius (float): The radius/distance from origin.
1853
+ angle (float): Angle in radians.
1854
+ radius (float): Distance from the origin.
1849
1855
  """
1850
1856
  @typing.overload
1851
1857
  def __init__(self, arg0: collections.abc.Sequence) -> None:
1852
1858
  """
1853
- Create a PolarCoordinate from a sequence of two elements.
1859
+ Initialize a PolarCoordinate from a two-item sequence.
1854
1860
 
1855
1861
  Args:
1856
- sequence: A sequence (list, tuple) containing [angle, radius].
1862
+ sequence (Sequence[float]): Iterable containing [angle, radius].
1857
1863
 
1858
1864
  Raises:
1859
- RuntimeError: If sequence doesn't contain exactly 2 elements.
1865
+ RuntimeError: If the sequence does not contain exactly two elements.
1860
1866
  """
1861
1867
  def __iter__(self) -> collections.abc.Iterator:
1862
- """
1863
- Return an iterator over (angle, radius).
1864
-
1865
- Returns:
1866
- iterator: Iterator that yields angle first, then radius.
1867
- """
1868
+ ...
1868
1869
  def __len__(self) -> int:
1869
- """
1870
- Return the number of components (always 2).
1871
-
1872
- Returns:
1873
- int: Always returns 2 (angle and radius).
1874
- """
1870
+ ...
1875
1871
  def __ne__(self, arg0: PolarCoordinate) -> bool:
1876
- """
1877
- Check if two PolarCoordinates are not equal.
1878
-
1879
- Args:
1880
- other (PolarCoordinate): The other PolarCoordinate to compare.
1881
-
1882
- Returns:
1883
- bool: True if angle or radius are different.
1884
- """
1872
+ ...
1885
1873
  def __repr__(self) -> str:
1886
- """
1887
- Return a string suitable for debugging and recreation.
1888
-
1889
- Returns:
1890
- str: String in format "PolarCoordinate(angle, radius)".
1891
- """
1874
+ ...
1892
1875
  def __setitem__(self, index: typing.SupportsInt, value: typing.SupportsFloat) -> None:
1893
- """
1894
- Set polar coordinate components by index.
1895
-
1896
- Args:
1897
- index (int): Index (0=angle, 1=radius).
1898
- value (float): The new value to set.
1899
-
1900
- Raises:
1901
- IndexError: If index is not 0 or 1.
1902
- """
1876
+ ...
1903
1877
  def __str__(self) -> str:
1904
- """
1905
- Return a human-readable string representation.
1906
-
1907
- Returns:
1908
- str: String in format "(angle, radius)".
1909
- """
1878
+ ...
1910
1879
  def to_cartesian(self) -> Vec2:
1911
1880
  """
1912
- Convert polar coordinates to Cartesian coordinates.
1881
+ Convert this PolarCoordinate to a Vec2.
1913
1882
 
1914
1883
  Returns:
1915
- Vec2: The equivalent Cartesian coordinates as a Vec2.
1884
+ Vec2: Cartesian representation of this coordinate.
1916
1885
  """
1917
1886
  @property
1918
1887
  def angle(self) -> float:
@@ -1940,48 +1909,95 @@ class Polygon:
1940
1909
 
1941
1910
  """
1942
1911
  def __getitem__(self, index: typing.SupportsInt) -> Vec2:
1912
+ ...
1913
+ @typing.overload
1914
+ def __init__(self) -> None:
1943
1915
  """
1944
- Get a point by index.
1916
+ Create an empty polygon with no points.
1917
+ """
1918
+ @typing.overload
1919
+ def __init__(self, points: collections.abc.Sequence[Vec2]) -> None:
1920
+ """
1921
+ Create a polygon from a vector of Vec2 points.
1945
1922
 
1946
1923
  Args:
1947
- index (int): The index of the point to retrieve.
1924
+ points (list[Vec2]): List of Vec2 points defining the polygon vertices.
1925
+ """
1926
+ def __iter__(self) -> collections.abc.Iterator:
1927
+ ...
1928
+ def __len__(self) -> int:
1929
+ ...
1930
+ def copy(self) -> Polygon:
1931
+ """
1932
+ Return a copy of the polygon.
1948
1933
 
1949
1934
  Returns:
1950
- Vec2: The point at the specified index.
1935
+ Polygon: A new polygon with the same points.
1936
+ """
1937
+ def rotate(self, angle: typing.SupportsFloat, pivot: Vec2) -> None:
1938
+ """
1939
+ Rotate the polygon around a pivot point.
1951
1940
 
1952
- Raises:
1953
- IndexError: If index is out of range.
1941
+ Args:
1942
+ angle (float): The rotation angle in radians.
1943
+ pivot (Vec2): The point to rotate around.
1954
1944
  """
1955
1945
  @typing.overload
1956
- def __init__(self) -> None:
1946
+ def scale(self, factor: typing.SupportsFloat, pivot: Vec2) -> None:
1957
1947
  """
1958
- Create an empty polygon with no points.
1948
+ Scale the polygon uniformly from a pivot point.
1949
+
1950
+ Args:
1951
+ factor (float): The scaling factor.
1952
+ pivot (Vec2): The point to scale from.
1959
1953
  """
1960
1954
  @typing.overload
1961
- def __init__(self, points: collections.abc.Sequence[Vec2]) -> None:
1955
+ def scale(self, factor: Vec2, pivot: Vec2) -> None:
1962
1956
  """
1963
- Create a polygon from a vector of Vec2 points.
1957
+ Scale the polygon non-uniformly from a pivot point.
1964
1958
 
1965
1959
  Args:
1966
- points (list[Vec2]): List of Vec2 points defining the polygon vertices.
1960
+ factor (Vec2): The scaling factors for x and y.
1961
+ pivot (Vec2): The point to scale from.
1967
1962
  """
1968
- def __iter__(self) -> collections.abc.Iterator:
1963
+ def translate(self, offset: Vec2) -> None:
1969
1964
  """
1970
- Return an iterator over the polygon's points.
1965
+ Move the polygon by an offset.
1966
+
1967
+ Args:
1968
+ offset (Vec2): The offset to move by.
1971
1969
  """
1972
- def __len__(self) -> int:
1970
+ @property
1971
+ def area(self) -> float:
1973
1972
  """
1974
- Return the number of points in the polygon.
1973
+ Get the area of the polygon.
1975
1974
 
1976
1975
  Returns:
1977
- int: The number of vertices.
1976
+ float: The area enclosed by the polygon.
1978
1977
  """
1979
- def copy(self) -> Polygon:
1978
+ @property
1979
+ def bounds(self) -> Rect:
1980
1980
  """
1981
- Return a copy of the polygon.
1981
+ Get the bounding rectangle of the polygon.
1982
1982
 
1983
1983
  Returns:
1984
- Polygon: A new polygon with the same points.
1984
+ Rect: The smallest rectangle that contains the polygon.
1985
+ """
1986
+ @property
1987
+ def centroid(self) -> Vec2:
1988
+ """
1989
+ Get the centroid of the polygon.
1990
+
1991
+ Returns:
1992
+ Vec2: The center point of the polygon.
1993
+ """
1994
+ @property
1995
+ def perimeter(self) -> float:
1996
+ """
1997
+ Get the perimeter of the polygon.
1998
+
1999
+ Returns:
2000
+ float: The total distance around the polygon.
1985
2001
  """
1986
2002
  @property
1987
2003
  def points(self) -> list[Vec2]:
@@ -1998,39 +2014,15 @@ class Rect:
1998
2014
 
1999
2015
  A Rect is defined by its top-left corner position (x, y) and dimensions (w, h).
2000
2016
  Supports various geometric operations, collision detection, and positioning methods.
2001
-
2017
+
2002
2018
  """
2003
2019
  __hash__: typing.ClassVar[None] = None
2004
2020
  def __bool__(self) -> bool:
2005
- """
2006
- Check if the rectangle has positive area.
2007
-
2008
- Returns:
2009
- bool: True if both width and height are greater than 0.
2010
- """
2021
+ ...
2011
2022
  def __eq__(self, other: Rect) -> bool:
2012
- """
2013
- Check if two rectangles are equal.
2014
-
2015
- Args:
2016
- other (Rect): The other rectangle to compare.
2017
-
2018
- Returns:
2019
- bool: True if all components (x, y, w, h) are equal.
2020
- """
2023
+ ...
2021
2024
  def __getitem__(self, index: typing.SupportsInt) -> float:
2022
- """
2023
- Access rectangle components by index.
2024
-
2025
- Args:
2026
- index (int): Index (0=x, 1=y, 2=w, 3=h).
2027
-
2028
- Returns:
2029
- float: The component value.
2030
-
2031
- Raises:
2032
- IndexError: If index is not 0, 1, 2, or 3.
2033
- """
2025
+ ...
2034
2026
  @typing.overload
2035
2027
  def __init__(self) -> None:
2036
2028
  """
@@ -2088,43 +2080,15 @@ class Rect:
2088
2080
  RuntimeError: If sequence doesn't contain exactly 4 elements.
2089
2081
  """
2090
2082
  def __iter__(self) -> collections.abc.Iterator:
2091
- """
2092
- Return an iterator over (x, y, w, h).
2093
-
2094
- Returns:
2095
- iterator: Iterator that yields x, y, w, h in order.
2096
- """
2083
+ ...
2097
2084
  def __len__(self) -> int:
2098
- """
2099
- Return the number of components (always 4).
2100
-
2101
- Returns:
2102
- int: Always returns 4 (x, y, w, h).
2103
- """
2085
+ ...
2104
2086
  def __ne__(self, other: Rect) -> bool:
2105
- """
2106
- Check if two rectangles are not equal.
2107
-
2108
- Args:
2109
- other (Rect): The other rectangle to compare.
2110
-
2111
- Returns:
2112
- bool: True if any component differs.
2113
- """
2087
+ ...
2114
2088
  def __repr__(self) -> str:
2115
- """
2116
- Return a string suitable for debugging and recreation.
2117
-
2118
- Returns:
2119
- str: String in format "Rect(x=..., y=..., w=..., h=...)".
2120
- """
2089
+ ...
2121
2090
  def __str__(self) -> str:
2122
- """
2123
- Return a human-readable string representation.
2124
-
2125
- Returns:
2126
- str: String in format "[x, y, w, h]".
2127
- """
2091
+ ...
2128
2092
  @typing.overload
2129
2093
  def clamp(self, other: Rect) -> None:
2130
2094
  """
@@ -2148,36 +2112,6 @@ class Rect:
2148
2112
  Raises:
2149
2113
  ValueError: If min >= max or rectangle is larger than the clamp area.
2150
2114
  """
2151
- def collide_point(self, point: Vec2) -> bool:
2152
- """
2153
- Check if a point is inside this rectangle.
2154
-
2155
- Args:
2156
- point (Vec2): The point to check.
2157
-
2158
- Returns:
2159
- bool: True if the point is inside this rectangle.
2160
- """
2161
- def collide_rect(self, other: Rect) -> bool:
2162
- """
2163
- Check if this rectangle collides with another rectangle.
2164
-
2165
- Args:
2166
- other (Rect): The rectangle to check collision with.
2167
-
2168
- Returns:
2169
- bool: True if the rectangles overlap.
2170
- """
2171
- def contains(self, other: Rect) -> bool:
2172
- """
2173
- Check if this rectangle completely contains another rectangle.
2174
-
2175
- Args:
2176
- other (Rect): The rectangle to check.
2177
-
2178
- Returns:
2179
- bool: True if this rectangle completely contains the other.
2180
- """
2181
2115
  def copy(self) -> Rect:
2182
2116
  """
2183
2117
  Create a copy of this rectangle.
@@ -2401,21 +2335,30 @@ class Scancode(enum.IntEnum):
2401
2335
  S_9: typing.ClassVar[Scancode] # value = <Scancode.S_9: 38>
2402
2336
  S_AGAIN: typing.ClassVar[Scancode] # value = <Scancode.S_AGAIN: 121>
2403
2337
  S_APOSTROPHE: typing.ClassVar[Scancode] # value = <Scancode.S_APOSTROPHE: 52>
2338
+ S_APPLICATION: typing.ClassVar[Scancode] # value = <Scancode.S_APPLICATION: 101>
2404
2339
  S_BACKSLASH: typing.ClassVar[Scancode] # value = <Scancode.S_BACKSLASH: 49>
2405
2340
  S_BACKSPACE: typing.ClassVar[Scancode] # value = <Scancode.S_BACKSPACE: 42>
2341
+ S_CALL: typing.ClassVar[Scancode] # value = <Scancode.S_CALL: 289>
2406
2342
  S_CAPS: typing.ClassVar[Scancode] # value = <Scancode.S_CAPS: 57>
2343
+ S_CHANNEL_DEC: typing.ClassVar[Scancode] # value = <Scancode.S_CHANNEL_DEC: 261>
2344
+ S_CHANNEL_INC: typing.ClassVar[Scancode] # value = <Scancode.S_CHANNEL_INC: 260>
2407
2345
  S_COMMA: typing.ClassVar[Scancode] # value = <Scancode.S_COMMA: 54>
2408
2346
  S_COPY: typing.ClassVar[Scancode] # value = <Scancode.S_COPY: 124>
2409
2347
  S_CUT: typing.ClassVar[Scancode] # value = <Scancode.S_CUT: 123>
2410
2348
  S_DEL: typing.ClassVar[Scancode] # value = <Scancode.S_DEL: 76>
2411
2349
  S_DOWN: typing.ClassVar[Scancode] # value = <Scancode.S_DOWN: 81>
2412
2350
  S_END: typing.ClassVar[Scancode] # value = <Scancode.S_END: 77>
2351
+ S_ENDCALL: typing.ClassVar[Scancode] # value = <Scancode.S_ENDCALL: 290>
2413
2352
  S_EQ: typing.ClassVar[Scancode] # value = <Scancode.S_EQ: 46>
2414
2353
  S_ESC: typing.ClassVar[Scancode] # value = <Scancode.S_ESC: 41>
2354
+ S_EXECUTE: typing.ClassVar[Scancode] # value = <Scancode.S_EXECUTE: 116>
2415
2355
  S_F1: typing.ClassVar[Scancode] # value = <Scancode.S_F1: 58>
2416
2356
  S_F10: typing.ClassVar[Scancode] # value = <Scancode.S_F10: 67>
2417
2357
  S_F11: typing.ClassVar[Scancode] # value = <Scancode.S_F11: 68>
2418
2358
  S_F12: typing.ClassVar[Scancode] # value = <Scancode.S_F12: 69>
2359
+ S_F13: typing.ClassVar[Scancode] # value = <Scancode.S_F13: 104>
2360
+ S_F14: typing.ClassVar[Scancode] # value = <Scancode.S_F14: 105>
2361
+ S_F15: typing.ClassVar[Scancode] # value = <Scancode.S_F15: 106>
2419
2362
  S_F2: typing.ClassVar[Scancode] # value = <Scancode.S_F2: 59>
2420
2363
  S_F3: typing.ClassVar[Scancode] # value = <Scancode.S_F3: 60>
2421
2364
  S_F4: typing.ClassVar[Scancode] # value = <Scancode.S_F4: 61>
@@ -2426,6 +2369,7 @@ class Scancode(enum.IntEnum):
2426
2369
  S_F9: typing.ClassVar[Scancode] # value = <Scancode.S_F9: 66>
2427
2370
  S_FIND: typing.ClassVar[Scancode] # value = <Scancode.S_FIND: 126>
2428
2371
  S_GRAVE: typing.ClassVar[Scancode] # value = <Scancode.S_GRAVE: 53>
2372
+ S_HELP: typing.ClassVar[Scancode] # value = <Scancode.S_HELP: 117>
2429
2373
  S_HOME: typing.ClassVar[Scancode] # value = <Scancode.S_HOME: 74>
2430
2374
  S_INS: typing.ClassVar[Scancode] # value = <Scancode.S_INS: 73>
2431
2375
  S_KP_0: typing.ClassVar[Scancode] # value = <Scancode.S_KP_0: 98>
@@ -2450,7 +2394,20 @@ class Scancode(enum.IntEnum):
2450
2394
  S_LEFT: typing.ClassVar[Scancode] # value = <Scancode.S_LEFT: 80>
2451
2395
  S_LGUI: typing.ClassVar[Scancode] # value = <Scancode.S_LGUI: 227>
2452
2396
  S_LSHIFT: typing.ClassVar[Scancode] # value = <Scancode.S_LSHIFT: 225>
2397
+ S_MEDIA_EJECT: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_EJECT: 270>
2398
+ S_MEDIA_FAST_FORWARD: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_FAST_FORWARD: 265>
2399
+ S_MEDIA_NEXT: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_NEXT: 267>
2400
+ S_MEDIA_PAUSE: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_PAUSE: 263>
2401
+ S_MEDIA_PLAY: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_PLAY: 262>
2402
+ S_MEDIA_PLAY_PAUSE: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_PLAY_PAUSE: 271>
2403
+ S_MEDIA_PREV: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_PREV: 268>
2404
+ S_MEDIA_REC: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_REC: 264>
2405
+ S_MEDIA_REWIND: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_REWIND: 266>
2406
+ S_MEDIA_SELECT: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_SELECT: 272>
2407
+ S_MEDIA_STOP: typing.ClassVar[Scancode] # value = <Scancode.S_MEDIA_STOP: 269>
2408
+ S_MENU: typing.ClassVar[Scancode] # value = <Scancode.S_MENU: 118>
2453
2409
  S_MINUS: typing.ClassVar[Scancode] # value = <Scancode.S_MINUS: 45>
2410
+ S_MODE: typing.ClassVar[Scancode] # value = <Scancode.S_MODE: 257>
2454
2411
  S_MUTE: typing.ClassVar[Scancode] # value = <Scancode.S_MUTE: 127>
2455
2412
  S_NUMLOCK: typing.ClassVar[Scancode] # value = <Scancode.S_NUMLOCK: 83>
2456
2413
  S_PASTE: typing.ClassVar[Scancode] # value = <Scancode.S_PASTE: 125>
@@ -2458,6 +2415,7 @@ class Scancode(enum.IntEnum):
2458
2415
  S_PERIOD: typing.ClassVar[Scancode] # value = <Scancode.S_PERIOD: 55>
2459
2416
  S_PGDOWN: typing.ClassVar[Scancode] # value = <Scancode.S_PGDOWN: 78>
2460
2417
  S_PGUP: typing.ClassVar[Scancode] # value = <Scancode.S_PGUP: 75>
2418
+ S_POWER: typing.ClassVar[Scancode] # value = <Scancode.S_POWER: 102>
2461
2419
  S_PRTSCR: typing.ClassVar[Scancode] # value = <Scancode.S_PRTSCR: 70>
2462
2420
  S_RALT: typing.ClassVar[Scancode] # value = <Scancode.S_RALT: 230>
2463
2421
  S_RBRACKET: typing.ClassVar[Scancode] # value = <Scancode.S_RBRACKET: 48>
@@ -2467,14 +2425,20 @@ class Scancode(enum.IntEnum):
2467
2425
  S_RIGHT: typing.ClassVar[Scancode] # value = <Scancode.S_RIGHT: 79>
2468
2426
  S_RSHIFT: typing.ClassVar[Scancode] # value = <Scancode.S_RSHIFT: 229>
2469
2427
  S_SCRLK: typing.ClassVar[Scancode] # value = <Scancode.S_SCRLK: 71>
2428
+ S_SELECT: typing.ClassVar[Scancode] # value = <Scancode.S_SELECT: 119>
2470
2429
  S_SEMICOLON: typing.ClassVar[Scancode] # value = <Scancode.S_SEMICOLON: 51>
2471
2430
  S_SLASH: typing.ClassVar[Scancode] # value = <Scancode.S_SLASH: 56>
2431
+ S_SLEEP: typing.ClassVar[Scancode] # value = <Scancode.S_SLEEP: 258>
2432
+ S_SOFTLEFT: typing.ClassVar[Scancode] # value = <Scancode.S_SOFTLEFT: 287>
2433
+ S_SOFTRIGHT: typing.ClassVar[Scancode] # value = <Scancode.S_SOFTRIGHT: 288>
2472
2434
  S_SPACE: typing.ClassVar[Scancode] # value = <Scancode.S_SPACE: 44>
2435
+ S_STOP: typing.ClassVar[Scancode] # value = <Scancode.S_STOP: 120>
2473
2436
  S_TAB: typing.ClassVar[Scancode] # value = <Scancode.S_TAB: 43>
2474
2437
  S_UNDO: typing.ClassVar[Scancode] # value = <Scancode.S_UNDO: 122>
2475
2438
  S_UP: typing.ClassVar[Scancode] # value = <Scancode.S_UP: 82>
2476
2439
  S_VOLDOWN: typing.ClassVar[Scancode] # value = <Scancode.S_VOLDOWN: 129>
2477
2440
  S_VOLUP: typing.ClassVar[Scancode] # value = <Scancode.S_VOLUP: 128>
2441
+ S_WAKE: typing.ClassVar[Scancode] # value = <Scancode.S_WAKE: 259>
2478
2442
  S_a: typing.ClassVar[Scancode] # value = <Scancode.S_a: 4>
2479
2443
  S_b: typing.ClassVar[Scancode] # value = <Scancode.S_b: 5>
2480
2444
  S_c: typing.ClassVar[Scancode] # value = <Scancode.S_c: 6>
@@ -2508,23 +2472,203 @@ class Scancode(enum.IntEnum):
2508
2472
  """
2509
2473
  Convert to a string according to format_spec.
2510
2474
  """
2511
- class Texture:
2475
+ class ShaderState:
2512
2476
  """
2513
-
2514
- Represents a hardware-accelerated image that can be efficiently rendered.
2515
-
2516
- Textures are optimized for fast rendering operations and support various effects
2517
- like rotation, flipping, tinting, alpha blending, and different blend modes.
2518
- They can be created from image files or pixel arrays.
2519
-
2477
+ Encapsulates a GPU shader and its associated render state.
2520
2478
  """
2521
- class Flip:
2479
+ def __init__(self, fragment_file_path: str, uniform_buffer_count: typing.SupportsInt = 0) -> None:
2522
2480
  """
2481
+ Create a ShaderState from the specified fragment shader file.
2523
2482
 
2524
- Controls horizontal and vertical flipping of a texture during rendering.
2525
-
2526
- Used to mirror textures along the horizontal and/or vertical axes without
2527
- creating additional texture data.
2483
+ Args:
2484
+ fragment_file_path (str): Path to the fragment shader file.
2485
+ uniform_buffer_count (int, optional): Number of uniform buffers used by the shader. Default is 0.
2486
+ """
2487
+ def bind(self) -> None:
2488
+ """
2489
+ Binds this shader state to the current render pass, making it active for subsequent draw calls.
2490
+ """
2491
+ def set_uniform(self, binding: typing.SupportsInt, data: collections.abc.Buffer) -> None:
2492
+ """
2493
+ Set uniform data for the fragment shader at the specified binding point.
2494
+
2495
+ Args:
2496
+ binding (int): Uniform buffer binding index.
2497
+ data (buffer): Buffer or bytes object containing the uniform data to upload.
2498
+ """
2499
+ def unbind(self) -> None:
2500
+ """
2501
+ Unbinds the current shader state, reverting to the default render state.
2502
+ """
2503
+ class SheetStrip:
2504
+ """
2505
+
2506
+ A descriptor for one horizontal strip (row) in a sprite sheet.
2507
+
2508
+ Defines a single animation within a sprite sheet by specifying the animation name,
2509
+ the number of frames to extract from the strip, and the playback speed in frames
2510
+ per second (FPS).
2511
+
2512
+ """
2513
+ def __init__(self, name: str, frame_count: typing.SupportsInt, fps: typing.SupportsInt) -> None:
2514
+ """
2515
+ Create a sprite sheet strip definition.
2516
+
2517
+ Args:
2518
+ name (str): Unique identifier for this animation.
2519
+ frame_count (int): Number of frames to extract from this strip/row.
2520
+ fps (int): Frames per second for playback timing.
2521
+ """
2522
+ @property
2523
+ def fps(self) -> int:
2524
+ """
2525
+ The playback speed in frames per second.
2526
+
2527
+ Determines how fast the animation plays. Higher values result in faster playback.
2528
+
2529
+ Type:
2530
+ int: The frames per second for this animation.
2531
+ """
2532
+ @fps.setter
2533
+ def fps(self, arg0: typing.SupportsInt) -> None:
2534
+ ...
2535
+ @property
2536
+ def frame_count(self) -> int:
2537
+ """
2538
+ The number of frames in this animation strip.
2539
+
2540
+ Specifies how many frames to extract from the horizontal strip in the sprite sheet,
2541
+ reading from left to right.
2542
+
2543
+ Type:
2544
+ int: The number of frames (must be positive).
2545
+ """
2546
+ @frame_count.setter
2547
+ def frame_count(self, arg0: typing.SupportsInt) -> None:
2548
+ ...
2549
+ @property
2550
+ def name(self) -> str:
2551
+ """
2552
+ The unique name identifier for this animation strip.
2553
+
2554
+ Type:
2555
+ str: The animation name used to reference this strip.
2556
+ """
2557
+ @name.setter
2558
+ def name(self, arg0: str) -> None:
2559
+ ...
2560
+ class Text:
2561
+ """
2562
+
2563
+ A text object for rendering text to the active renderer.
2564
+
2565
+ This class handles the rendered text instance. You must provide a Font object
2566
+ when creating a Text instance.
2567
+
2568
+ Note:
2569
+ A window/renderer must be created before using text. Typically you should
2570
+ call kn.window.create(...) first, which initializes the text engine.
2571
+
2572
+ """
2573
+ def __init__(self, font: Font) -> None:
2574
+ """
2575
+ Create a Text object.
2576
+
2577
+ Args:
2578
+ font (Font): The font to use for rendering this text.
2579
+
2580
+ Raises:
2581
+ RuntimeError: If text creation fails.
2582
+ """
2583
+ def draw(self, pos: typing.Any = None, anchor: Anchor = Anchor.TOP_LEFT) -> None:
2584
+ """
2585
+ Draw the text to the renderer at the specified position with alignment.
2586
+
2587
+ Args:
2588
+ pos (Vec2 | None): The position in pixels. Defaults to (0, 0).
2589
+ anchor (Anchor): The anchor point for alignment. Defaults to TopLeft.
2590
+ """
2591
+ def get_rect(self) -> Rect:
2592
+ """
2593
+ Get the bounding rectangle of the current text.
2594
+
2595
+ Returns:
2596
+ Rect: A rectangle with x=0, y=0, and width/height of the text.
2597
+ """
2598
+ def set_font(self, font: Font) -> None:
2599
+ """
2600
+ Set the font to use for rendering this text.
2601
+
2602
+ Args:
2603
+ font (Font): The font to use.
2604
+ """
2605
+ @property
2606
+ def color(self) -> Color:
2607
+ """
2608
+ Get or set the color of the rendered text.
2609
+ """
2610
+ @color.setter
2611
+ def color(self, arg1: Color) -> None:
2612
+ ...
2613
+ @property
2614
+ def height(self) -> int:
2615
+ """
2616
+ Get the height in pixels of the current text.
2617
+
2618
+ Returns:
2619
+ int: The text height.
2620
+ """
2621
+ @property
2622
+ def size(self) -> Vec2:
2623
+ """
2624
+ Get the size (width, height) of the current text as a Vec2.
2625
+
2626
+ Returns:
2627
+ Vec2: The text dimensions.
2628
+ """
2629
+ @property
2630
+ def text(self) -> str:
2631
+ """
2632
+ Get or set the text string to be rendered.
2633
+ """
2634
+ @text.setter
2635
+ def text(self, arg1: str) -> None:
2636
+ ...
2637
+ @property
2638
+ def width(self) -> int:
2639
+ """
2640
+ Get the width in pixels of the current text.
2641
+
2642
+ Returns:
2643
+ int: The text width.
2644
+ """
2645
+ @property
2646
+ def wrap_width(self) -> int:
2647
+ """
2648
+ Get or set the wrap width in pixels for text wrapping.
2649
+
2650
+ Set to 0 to disable wrapping. Negative values are clamped to 0.
2651
+ """
2652
+ @wrap_width.setter
2653
+ def wrap_width(self, arg1: typing.SupportsInt) -> None:
2654
+ ...
2655
+ class Texture:
2656
+ """
2657
+
2658
+ Represents a hardware-accelerated image that can be efficiently rendered.
2659
+
2660
+ Textures are optimized for fast rendering operations and support various effects
2661
+ like rotation, flipping, tinting, alpha blending, and different blend modes.
2662
+ They can be created from image files or pixel arrays.
2663
+
2664
+ """
2665
+ class Flip:
2666
+ """
2667
+
2668
+ Controls horizontal and vertical flipping of a texture during rendering.
2669
+
2670
+ Used to mirror textures along the horizontal and/or vertical axes without
2671
+ creating additional texture data.
2528
2672
 
2529
2673
  """
2530
2674
  @property
@@ -2645,9 +2789,6 @@ class Tile:
2645
2789
  """
2646
2790
 
2647
2791
  Represents a single tile instance in a layer.
2648
-
2649
- Contains source and destination rectangles, a collider, flip flags, rotation angle,
2650
- and a reference to its owning Layer.
2651
2792
 
2652
2793
  """
2653
2794
  @property
@@ -2676,7 +2817,7 @@ class Tile:
2676
2817
  Whether the tile is flipped horizontally.
2677
2818
  """
2678
2819
  @property
2679
- def layer(self) -> Layer:
2820
+ def layer(self) -> TileLayer:
2680
2821
  """
2681
2822
  Get the owning Layer.
2682
2823
 
@@ -2693,6 +2834,76 @@ class Tile:
2693
2834
  """
2694
2835
  Whether the tile is flipped vertically.
2695
2836
  """
2837
+ class TileLayer:
2838
+ """
2839
+
2840
+ A layer of a tile map.
2841
+
2842
+ Layers can be either tile layers or object layers and contain a list of tiles.
2843
+
2844
+ """
2845
+ class Type(enum.IntEnum):
2846
+ """
2847
+
2848
+ The type of a Layer.
2849
+
2850
+ """
2851
+ OBJECT: typing.ClassVar[TileLayer.Type] # value = <Type.OBJECT: 0>
2852
+ TILE: typing.ClassVar[TileLayer.Type] # value = <Type.TILE: 1>
2853
+ @classmethod
2854
+ def __new__(cls, value):
2855
+ ...
2856
+ def __format__(self, format_spec):
2857
+ """
2858
+ Convert to a string according to format_spec.
2859
+ """
2860
+ OBJECT: typing.ClassVar[TileLayer.Type] # value = <Type.OBJECT: 0>
2861
+ TILE: typing.ClassVar[TileLayer.Type] # value = <Type.TILE: 1>
2862
+ def get_from_area(self, area: Rect) -> list[Tile]:
2863
+ """
2864
+ Get all tiles whose destination rectangles fall within a query rect.
2865
+
2866
+ Args:
2867
+ area (Rect): The world-space rectangle to test.
2868
+
2869
+ Returns:
2870
+ list[Tile]: Tiles intersecting the given area.
2871
+ """
2872
+ def get_tile_at(self, column: typing.SupportsInt, row: typing.SupportsInt) -> pykraken._core.Tile | None:
2873
+ """
2874
+ Get the tile located at the specified grid coordinates.
2875
+
2876
+ Args:
2877
+ column (int): The tile column index.
2878
+ row (int): The tile row index.
2879
+
2880
+ Returns:
2881
+ Tile | None: The tile at the grid coordinate, or None if empty/out of range.
2882
+ """
2883
+ def render(self) -> None:
2884
+ """
2885
+ Render the layer.
2886
+ """
2887
+ @property
2888
+ def is_visible(self) -> bool:
2889
+ """
2890
+ Whether the layer is visible.
2891
+ """
2892
+ @property
2893
+ def name(self) -> str:
2894
+ """
2895
+ The name of the layer.
2896
+ """
2897
+ @property
2898
+ def tiles(self) -> list[Tile]:
2899
+ """
2900
+ The list of Tile instances contained in this layer.
2901
+ """
2902
+ @property
2903
+ def type(self) -> TileLayer.Type:
2904
+ """
2905
+ The layer type (OBJECT or TILE).
2906
+ """
2696
2907
  class TileMap:
2697
2908
  """
2698
2909
 
@@ -2702,7 +2913,7 @@ class TileMap:
2702
2913
 
2703
2914
  """
2704
2915
  @staticmethod
2705
- def get_tile_collection(layers: collections.abc.Sequence[Layer]) -> list[Tile]:
2916
+ def get_tile_collection(layers: collections.abc.Sequence[TileLayer]) -> list[Tile]:
2706
2917
  """
2707
2918
  Collect all tiles from the provided layers into a single list.
2708
2919
 
@@ -2723,7 +2934,7 @@ class TileMap:
2723
2934
  Raises:
2724
2935
  RuntimeError: If the TMX or TSX files cannot be loaded or parsed.
2725
2936
  """
2726
- def get_layer(self, name: str, type: Layer.Type = Layer.Type.TILE) -> Layer:
2937
+ def get_layer(self, name: str, type: TileLayer.Type = TileLayer.Type.TILE) -> TileLayer:
2727
2938
  """
2728
2939
  Get a layer by name and type.
2729
2940
 
@@ -2737,7 +2948,7 @@ class TileMap:
2737
2948
  Raises:
2738
2949
  ValueError: If no matching layer is found or the type doesn't match.
2739
2950
  """
2740
- def get_layers(self) -> list[Layer]:
2951
+ def get_layers(self) -> list[TileLayer]:
2741
2952
  """
2742
2953
  Get all layers in the map.
2743
2954
 
@@ -2832,340 +3043,226 @@ class Timer:
2832
3043
  class Vec2:
2833
3044
  """
2834
3045
 
2835
- Represents a 2D vector with x and y components.
3046
+ Vec2 represents a 2D vector.
2836
3047
 
2837
- Vec2 is used for positions, directions, velocities, and other 2D vector operations.
2838
- Supports arithmetic operations, comparisons, and various mathematical functions.
2839
-
3048
+ Attributes:
3049
+ x (float): Horizontal component.
3050
+ y (float): Vertical component.
3051
+
3052
+ Methods:
3053
+ copy: Return a duplicated Vec2.
3054
+ is_zero: Test whether components are near zero.
3055
+ rotate: Rotate the vector in place.
3056
+ to_polar: Convert the vector to a PolarCoordinate.
3057
+ scale_to_length: Scale the vector to a specific length.
3058
+ project: Project onto another Vec2.
3059
+ reject: Remove the projection onto another Vec2.
3060
+ reflect: Reflect across another Vec2.
3061
+ normalize: Normalize the vector in place.
3062
+ distance_to: Measure distance to another Vec2.
3063
+ distance_squared_to: Measure squared distance to another Vec2.
3064
+
2840
3065
  """
2841
3066
  def __add__(self, other: Vec2) -> Vec2:
2842
- """
2843
- Add another Vec2 to this Vec2.
2844
-
2845
- Args:
2846
- other (Vec2): The Vec2 to add.
2847
-
2848
- Returns:
2849
- Vec2: A new Vec2 with the result of the addition.
2850
- """
3067
+ ...
2851
3068
  def __bool__(self) -> bool:
2852
- """
2853
- Check if the vector is not zero.
2854
-
2855
- Returns:
2856
- bool: True if the vector is not zero, False if it is zero.
2857
- """
3069
+ ...
2858
3070
  def __eq__(self, other: Vec2) -> bool:
2859
- """
2860
- Check if two Vec2s are equal (within tolerance).
2861
-
2862
- Args:
2863
- other (Vec2): The other Vec2 to compare.
2864
-
2865
- Returns:
2866
- bool: True if vectors are equal within tolerance.
2867
- """
3071
+ ...
2868
3072
  def __ge__(self, other: Vec2) -> bool:
2869
- """
2870
- Check if this Vec2 is component-wise greater than or equal to another.
2871
-
2872
- Args:
2873
- other (Vec2): The other Vec2 to compare.
2874
-
2875
- Returns:
2876
- bool: True if not component-wise less than other.
2877
- """
3073
+ ...
2878
3074
  def __getitem__(self, index: typing.SupportsInt) -> float:
2879
- """
2880
- Access vector components by index.
2881
-
2882
- Args:
2883
- index (int): Index (0=x, 1=y).
2884
-
2885
- Returns:
2886
- float: The component value.
2887
-
2888
- Raises:
2889
- IndexError: If index is not 0 or 1.
2890
- """
3075
+ ...
2891
3076
  def __gt__(self, other: Vec2) -> bool:
2892
- """
2893
- Check if this Vec2 is component-wise greater than another.
2894
-
2895
- Args:
2896
- other (Vec2): The other Vec2 to compare.
2897
-
2898
- Returns:
2899
- bool: True if both x and y are greater than other's x and y.
2900
- """
3077
+ ...
2901
3078
  def __hash__(self) -> int:
2902
- """
2903
- Return a hash value for the Vec2.
2904
-
2905
- Returns:
2906
- int: Hash value based on x and y components.
2907
- """
3079
+ ...
2908
3080
  def __iadd__(self, other: Vec2) -> Vec2:
2909
- """
2910
- In-place addition (self += other).
2911
-
2912
- Args:
2913
- other (Vec2): The Vec2 to add.
2914
-
2915
- Returns:
2916
- Vec2: Reference to self after modification.
2917
- """
3081
+ ...
2918
3082
  def __imul__(self, scalar: typing.SupportsFloat) -> Vec2:
2919
- """
2920
- In-place multiplication by a scalar value (self *= scalar).
2921
-
2922
- Args:
2923
- scalar (float): The scalar to multiply by.
2924
-
2925
- Returns:
2926
- Vec2: Reference to self after modification.
2927
- """
3083
+ ...
2928
3084
  @typing.overload
2929
3085
  def __init__(self) -> None:
2930
3086
  """
2931
- Create a zero vector (0, 0).
3087
+ Initialize a Vec2 with zeroed components.
2932
3088
  """
2933
3089
  @typing.overload
2934
3090
  def __init__(self, value: typing.SupportsFloat) -> None:
2935
3091
  """
2936
- Create a Vec2 with both x and y set to the same value.
3092
+ Initialize a Vec2 with identical x and y values.
2937
3093
 
2938
3094
  Args:
2939
- value (float): Value to set for both x and y components.
3095
+ value (float): Value assigned to both components.
2940
3096
  """
2941
3097
  @typing.overload
2942
3098
  def __init__(self, x: typing.SupportsFloat, y: typing.SupportsFloat) -> None:
2943
3099
  """
2944
- Create a Vec2 with given x and y values.
3100
+ Initialize a Vec2 with explicit component values.
2945
3101
 
2946
3102
  Args:
2947
- x (float): The x component.
2948
- y (float): The y component.
3103
+ x (float): Horizontal component.
3104
+ y (float): Vertical component.
2949
3105
  """
2950
3106
  @typing.overload
2951
3107
  def __init__(self, arg0: collections.abc.Sequence) -> None:
2952
3108
  """
2953
- Create a Vec2 from a sequence of two elements.
3109
+ Initialize a Vec2 from a two-item sequence.
2954
3110
 
2955
3111
  Args:
2956
- sequence: A sequence (list, tuple) containing [x, y].
3112
+ sequence (Sequence[float]): Iterable containing [x, y].
2957
3113
 
2958
3114
  Raises:
2959
- RuntimeError: If sequence doesn't contain exactly 2 elements.
3115
+ RuntimeError: If the sequence does not contain exactly two elements.
2960
3116
  """
2961
3117
  def __isub__(self, other: Vec2) -> Vec2:
2962
- """
2963
- In-place subtraction (self -= other).
2964
-
2965
- Args:
2966
- other (Vec2): The Vec2 to subtract.
2967
-
2968
- Returns:
2969
- Vec2: Reference to self after modification.
2970
- """
3118
+ ...
2971
3119
  def __iter__(self) -> collections.abc.Iterator:
2972
- """
2973
- Return an iterator over (x, y).
2974
-
2975
- Returns:
2976
- iterator: Iterator that yields x first, then y.
2977
- """
3120
+ ...
2978
3121
  def __itruediv__(self, scalar: typing.SupportsFloat) -> Vec2:
2979
- """
2980
- In-place division by a scalar value (self /= scalar).
2981
-
2982
- Args:
2983
- scalar (float): The scalar to divide by.
2984
-
2985
- Returns:
2986
- Vec2: Reference to self after modification.
2987
- """
3122
+ ...
2988
3123
  def __le__(self, other: Vec2) -> bool:
2989
- """
2990
- Check if this Vec2 is component-wise less than or equal to another.
2991
-
2992
- Args:
2993
- other (Vec2): The other Vec2 to compare.
2994
-
2995
- Returns:
2996
- bool: True if not component-wise greater than other.
2997
- """
3124
+ ...
2998
3125
  def __len__(self) -> int:
2999
- """
3000
- Return the number of components (always 2).
3001
-
3002
- Returns:
3003
- int: Always returns 2 (x and y).
3004
- """
3126
+ ...
3005
3127
  def __lt__(self, other: Vec2) -> bool:
3006
- """
3007
- Check if this Vec2 is component-wise less than another.
3008
-
3009
- Args:
3010
- other (Vec2): The other Vec2 to compare.
3011
-
3012
- Returns:
3013
- bool: True if both x and y are less than other's x and y.
3014
- """
3128
+ ...
3015
3129
  def __mul__(self, scalar: typing.SupportsFloat) -> Vec2:
3016
- """
3017
- Multiply the vector by a scalar value.
3018
-
3019
- Args:
3020
- scalar (float): The scalar to multiply by.
3021
-
3022
- Returns:
3023
- Vec2: A new Vec2 with multiplied components.
3024
- """
3130
+ ...
3025
3131
  def __ne__(self, other: Vec2) -> bool:
3026
- """
3027
- Check if two Vec2s are not equal.
3028
-
3029
- Args:
3030
- other (Vec2): The other Vec2 to compare.
3031
-
3032
- Returns:
3033
- bool: True if vectors are not equal.
3034
- """
3132
+ ...
3035
3133
  def __neg__(self) -> Vec2:
3036
- """
3037
- Return the negation of this vector (-self).
3038
-
3039
- Returns:
3040
- Vec2: A new Vec2 with negated x and y components.
3041
- """
3134
+ ...
3042
3135
  def __radd__(self, other: Vec2) -> Vec2:
3043
- """
3044
- Right-hand addition (other + self).
3045
-
3046
- Args:
3047
- other (Vec2): The Vec2 to add.
3048
-
3049
- Returns:
3050
- Vec2: A new Vec2 with the result of the addition.
3051
- """
3136
+ ...
3052
3137
  def __repr__(self) -> str:
3138
+ ...
3139
+ def __rmul__(self, scalar: typing.SupportsFloat) -> Vec2:
3140
+ ...
3141
+ def __rsub__(self, other: Vec2) -> Vec2:
3142
+ ...
3143
+ def __setitem__(self, index: typing.SupportsInt, value: typing.SupportsFloat) -> None:
3144
+ ...
3145
+ def __str__(self) -> str:
3146
+ ...
3147
+ def __sub__(self, other: Vec2) -> Vec2:
3148
+ ...
3149
+ def __truediv__(self, scalar: typing.SupportsFloat) -> Vec2:
3150
+ ...
3151
+ def copy(self) -> Vec2:
3053
3152
  """
3054
- Return a string suitable for debugging and recreation.
3153
+ Return a copy of this Vec2.
3055
3154
 
3056
3155
  Returns:
3057
- str: String in format "Vec2(x, y)".
3156
+ Vec2: A duplicated vector with the same components.
3058
3157
  """
3059
- def __rmul__(self, scalar: typing.SupportsFloat) -> Vec2:
3158
+ def distance_squared_to(self, other: Vec2) -> float:
3060
3159
  """
3061
- Right-hand multiplication (scalar * self).
3160
+ Compute the squared distance to another Vec2.
3062
3161
 
3063
3162
  Args:
3064
- scalar (float): The scalar to multiply by.
3163
+ other (Vec2): Comparison vector.
3065
3164
 
3066
3165
  Returns:
3067
- Vec2: A new Vec2 with multiplied components.
3166
+ float: Squared distance between the vectors.
3068
3167
  """
3069
- def __rsub__(self, other: Vec2) -> Vec2:
3168
+ def distance_to(self, other: Vec2) -> float:
3070
3169
  """
3071
- Right-hand subtraction (other - self).
3170
+ Compute the Euclidean distance to another Vec2.
3072
3171
 
3073
3172
  Args:
3074
- other (Vec2): The Vec2 to subtract from.
3173
+ other (Vec2): Comparison vector.
3075
3174
 
3076
3175
  Returns:
3077
- Vec2: A new Vec2 with the result of the subtraction.
3176
+ float: Distance between the vectors.
3078
3177
  """
3079
- def __setitem__(self, index: typing.SupportsInt, value: typing.SupportsFloat) -> None:
3178
+ def is_zero(self, tolerance: typing.SupportsFloat = 1e-08) -> bool:
3080
3179
  """
3081
- Set vector components by index.
3180
+ Determine whether this Vec2 is effectively zero.
3082
3181
 
3083
3182
  Args:
3084
- index (int): Index (0=x, 1=y).
3085
- value (float): The new value to set.
3183
+ tolerance (float): Largest allowed absolute component magnitude.
3086
3184
 
3087
- Raises:
3088
- IndexError: If index is not 0 or 1.
3185
+ Returns:
3186
+ bool: True if both components are within the tolerance.
3089
3187
  """
3090
- def __str__(self) -> str:
3188
+ def normalize(self) -> None:
3091
3189
  """
3092
- Return a human-readable string representation.
3093
-
3094
- Returns:
3095
- str: String in format "<x, y>".
3190
+ Normalize this Vec2 in place.
3096
3191
  """
3097
- def __sub__(self, other: Vec2) -> Vec2:
3192
+ def project(self, other: Vec2) -> Vec2:
3098
3193
  """
3099
- Subtract another Vec2 from this Vec2.
3194
+ Project this Vec2 onto another Vec2.
3100
3195
 
3101
3196
  Args:
3102
- other (Vec2): The Vec2 to subtract.
3197
+ other (Vec2): The vector to project onto.
3103
3198
 
3104
3199
  Returns:
3105
- Vec2: A new Vec2 with the result of the subtraction.
3200
+ Vec2: Projection of this vector onto the other vector.
3106
3201
  """
3107
- def __truediv__(self, scalar: typing.SupportsFloat) -> Vec2:
3202
+ def reflect(self, other: Vec2) -> Vec2:
3108
3203
  """
3109
- Divide the vector by a scalar value.
3204
+ Reflect this Vec2 across another Vec2.
3110
3205
 
3111
3206
  Args:
3112
- scalar (float): The scalar to divide by.
3207
+ other (Vec2): The vector used as the reflection normal.
3113
3208
 
3114
3209
  Returns:
3115
- Vec2: A new Vec2 with divided components.
3210
+ Vec2: Reflected vector.
3116
3211
  """
3117
- def distance_to(self, other: Vec2) -> float:
3212
+ def reject(self, other: Vec2) -> Vec2:
3118
3213
  """
3119
- Calculate the distance to another vector.
3214
+ Compute the rejection of this Vec2 from another Vec2.
3120
3215
 
3121
3216
  Args:
3122
- other (Vec2): The other vector.
3217
+ other (Vec2): The vector defining the projection axis.
3123
3218
 
3124
3219
  Returns:
3125
- float: The Euclidean distance between the vectors.
3126
- """
3127
- def normalize(self) -> None:
3128
- """
3129
- Normalize the vector to unit length in-place.
3130
-
3131
- If the vector is zero, it remains unchanged.
3220
+ Vec2: Component of this vector orthogonal to the other vector.
3132
3221
  """
3133
3222
  def rotate(self, radians: typing.SupportsFloat) -> None:
3134
3223
  """
3135
- Rotate the vector by the given angle in radians.
3224
+ Rotate this Vec2 in place.
3136
3225
 
3137
3226
  Args:
3138
- radians (float): The angle to rotate by in radians.
3227
+ radians (float): Rotation angle in radians.
3139
3228
  """
3140
3229
  def scale_to_length(self, length: typing.SupportsFloat) -> None:
3141
3230
  """
3142
- Scale the vector to the specified length in-place.
3231
+ Scale this Vec2 to a specific magnitude.
3143
3232
 
3144
3233
  Args:
3145
- length (float): The target length.
3234
+ length (float): Target vector length.
3146
3235
  """
3147
3236
  def to_polar(self) -> PolarCoordinate:
3148
3237
  """
3149
- Convert to polar coordinates.
3238
+ Convert this Vec2 to polar coordinates.
3150
3239
 
3151
3240
  Returns:
3152
- PolarCoordinate: A polar coordinate representation (angle, length).
3241
+ PolarCoordinate: Polar representation with angle and length.
3153
3242
  """
3154
3243
  @property
3155
3244
  def angle(self) -> float:
3156
3245
  """
3157
- Get the angle of the vector in radians.
3246
+ Return the vector angle in radians.
3158
3247
 
3159
3248
  Returns:
3160
- float: The angle from the positive x-axis to this vector.
3249
+ float: Angle measured from the positive x-axis.
3161
3250
  """
3162
3251
  @property
3163
3252
  def length(self) -> float:
3164
3253
  """
3165
- Get the length (magnitude) of the vector.
3254
+ Return the magnitude of this Vec2.
3166
3255
 
3167
3256
  Returns:
3168
- float: The Euclidean length of the vector.
3257
+ float: Euclidean length of the vector.
3258
+ """
3259
+ @property
3260
+ def length_squared(self) -> float:
3261
+ """
3262
+ Return the squared magnitude of this Vec2.
3263
+
3264
+ Returns:
3265
+ float: Squared Euclidean length.
3169
3266
  """
3170
3267
  @property
3171
3268
  def x(self) -> float:
@@ -3178,12 +3275,18 @@ class Vec2:
3178
3275
  @property
3179
3276
  def xx(self) -> Vec2:
3180
3277
  """
3181
- Get a new Vec2 with both components set to x.
3278
+ Return a Vec2 with both components set to x.
3279
+
3280
+ Returns:
3281
+ Vec2: Vector composed of (x, x).
3182
3282
  """
3183
3283
  @property
3184
3284
  def xy(self) -> Vec2:
3185
3285
  """
3186
- Get or set the (x, y) components as a new Vec2.
3286
+ Access or assign the (x, y) components as a Vec2.
3287
+
3288
+ Returns:
3289
+ Vec2: Current (x, y) components.
3187
3290
  """
3188
3291
  @xy.setter
3189
3292
  def xy(self, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None:
@@ -3199,7 +3302,10 @@ class Vec2:
3199
3302
  @property
3200
3303
  def yx(self) -> Vec2:
3201
3304
  """
3202
- Get or set the (y, x) components as a new Vec2.
3305
+ Access or assign the (y, x) components as a Vec2.
3306
+
3307
+ Returns:
3308
+ Vec2: Current (y, x) components.
3203
3309
  """
3204
3310
  @yx.setter
3205
3311
  def yx(self, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None:
@@ -3207,31 +3313,40 @@ class Vec2:
3207
3313
  @property
3208
3314
  def yy(self) -> Vec2:
3209
3315
  """
3210
- Get a new Vec2 with both components set to y.
3316
+ Return a Vec2 with both components set to y.
3317
+
3318
+ Returns:
3319
+ Vec2: Vector composed of (y, y).
3320
+ """
3321
+ class ViewportMode(enum.IntEnum):
3322
+ HORIZONTAL: typing.ClassVar[ViewportMode] # value = <ViewportMode.HORIZONTAL: 1>
3323
+ VERTICAL: typing.ClassVar[ViewportMode] # value = <ViewportMode.VERTICAL: 0>
3324
+ @classmethod
3325
+ def __new__(cls, value):
3326
+ ...
3327
+ def __format__(self, format_spec):
3328
+ """
3329
+ Convert to a string according to format_spec.
3211
3330
  """
3212
3331
  def init() -> None:
3213
3332
  """
3214
- Initialize the Kraken Engine.
3333
+ Initialize the Kraken engine subsystems.
3215
3334
 
3216
- This sets up internal systems and must be called before using any other features.
3335
+ Raises:
3336
+ RuntimeError: If SDL initialization fails.
3217
3337
  """
3218
3338
  def quit() -> None:
3219
3339
  """
3220
- Shut down the Kraken Engine and clean up resources.
3221
-
3222
- Call this once you're done using the engine to avoid memory leaks.
3340
+ Tear down the Kraken engine subsystems.
3223
3341
  """
3224
3342
  AUDIO_DEVICE_ADDED: EventType # value = <EventType.AUDIO_DEVICE_ADDED: 4352>
3225
3343
  AUDIO_DEVICE_FORMAT_CHANGED: EventType # value = <EventType.AUDIO_DEVICE_FORMAT_CHANGED: 4354>
3226
3344
  AUDIO_DEVICE_REMOVED: EventType # value = <EventType.AUDIO_DEVICE_REMOVED: 4353>
3227
- BOTTOM_LEFT: Anchor # value = <Anchor.BOTTOM_LEFT: 6>
3228
- BOTTOM_MID: Anchor # value = <Anchor.BOTTOM_MID: 7>
3229
- BOTTOM_RIGHT: Anchor # value = <Anchor.BOTTOM_RIGHT: 8>
3230
- CAMERA_ADDED: EventType # value = <EventType.CAMERA_ADDED: 5120>
3231
- CAMERA_APPROVED: EventType # value = <EventType.CAMERA_APPROVED: 5122>
3232
- CAMERA_DENIED: EventType # value = <EventType.CAMERA_DENIED: 5123>
3233
- CAMERA_REMOVED: EventType # value = <EventType.CAMERA_REMOVED: 5121>
3234
- CENTER: Anchor # value = <Anchor.CENTER: 4>
3345
+ CAMERA_DEVICE_ADDED: EventType # value = <EventType.CAMERA_DEVICE_ADDED: 5120>
3346
+ CAMERA_DEVICE_APPROVED: EventType # value = <EventType.CAMERA_DEVICE_APPROVED: 5122>
3347
+ CAMERA_DEVICE_DENIED: EventType # value = <EventType.CAMERA_DEVICE_DENIED: 5123>
3348
+ CAMERA_DEVICE_REMOVED: EventType # value = <EventType.CAMERA_DEVICE_REMOVED: 5121>
3349
+ CLIPBOARD_UPDATE: EventType # value = <EventType.CLIPBOARD_UPDATE: 2304>
3235
3350
  C_BACK: GamepadButton # value = <GamepadButton.C_BACK: 4>
3236
3351
  C_DPAD_DOWN: GamepadButton # value = <GamepadButton.C_DPAD_DOWN: 12>
3237
3352
  C_DPAD_LEFT: GamepadButton # value = <GamepadButton.C_DPAD_LEFT: 13>
@@ -3263,21 +3378,39 @@ C_SWITCH_PRO: GamepadType # value = <GamepadType.C_SWITCH_PRO: 7>
3263
3378
  C_WEST: GamepadButton # value = <GamepadButton.C_WEST: 2>
3264
3379
  C_XBOX_360: GamepadType # value = <GamepadType.C_XBOX_360: 2>
3265
3380
  C_XBOX_ONE: GamepadType # value = <GamepadType.C_XBOX_ONE: 3>
3381
+ DID_ENTER_BACKGROUND: EventType # value = <EventType.DID_ENTER_BACKGROUND: 260>
3382
+ DID_ENTER_FOREGROUND: EventType # value = <EventType.DID_ENTER_FOREGROUND: 262>
3383
+ DISPLAY_ADDED: EventType # value = <EventType.DISPLAY_ADDED: 338>
3384
+ DISPLAY_CONTENT_SCALE_CHANGED: EventType # value = <EventType.DISPLAY_CONTENT_SCALE_CHANGED: 343>
3385
+ DISPLAY_CURRENT_MODE_CHANGED: EventType # value = <EventType.DISPLAY_CURRENT_MODE_CHANGED: 342>
3386
+ DISPLAY_DESKTOP_MODE_CHANGED: EventType # value = <EventType.DISPLAY_DESKTOP_MODE_CHANGED: 341>
3387
+ DISPLAY_MOVED: EventType # value = <EventType.DISPLAY_MOVED: 340>
3388
+ DISPLAY_ORIENTATION: EventType # value = <EventType.DISPLAY_ORIENTATION: 337>
3389
+ DISPLAY_REMOVED: EventType # value = <EventType.DISPLAY_REMOVED: 339>
3266
3390
  DROP_BEGIN: EventType # value = <EventType.DROP_BEGIN: 4098>
3267
3391
  DROP_COMPLETE: EventType # value = <EventType.DROP_COMPLETE: 4099>
3268
3392
  DROP_FILE: EventType # value = <EventType.DROP_FILE: 4096>
3269
3393
  DROP_POSITION: EventType # value = <EventType.DROP_POSITION: 4100>
3270
3394
  DROP_TEXT: EventType # value = <EventType.DROP_TEXT: 4097>
3395
+ FINGER_CANCELED: EventType # value = <EventType.FINGER_CANCELED: 1795>
3396
+ FINGER_DOWN: EventType # value = <EventType.FINGER_DOWN: 1792>
3397
+ FINGER_MOTION: EventType # value = <EventType.FINGER_MOTION: 1794>
3398
+ FINGER_UP: EventType # value = <EventType.FINGER_UP: 1793>
3271
3399
  GAMEPAD_ADDED: EventType # value = <EventType.GAMEPAD_ADDED: 1619>
3272
3400
  GAMEPAD_AXIS_MOTION: EventType # value = <EventType.GAMEPAD_AXIS_MOTION: 1616>
3273
3401
  GAMEPAD_BUTTON_DOWN: EventType # value = <EventType.GAMEPAD_BUTTON_DOWN: 1617>
3274
3402
  GAMEPAD_BUTTON_UP: EventType # value = <EventType.GAMEPAD_BUTTON_UP: 1618>
3403
+ GAMEPAD_REMAPPED: EventType # value = <EventType.GAMEPAD_REMAPPED: 1621>
3275
3404
  GAMEPAD_REMOVED: EventType # value = <EventType.GAMEPAD_REMOVED: 1620>
3405
+ GAMEPAD_SENSOR_UPDATE: EventType # value = <EventType.GAMEPAD_SENSOR_UPDATE: 1625>
3406
+ GAMEPAD_STEAM_HANDLE_UPDATED: EventType # value = <EventType.GAMEPAD_STEAM_HANDLE_UPDATED: 1627>
3276
3407
  GAMEPAD_TOUCHPAD_DOWN: EventType # value = <EventType.GAMEPAD_TOUCHPAD_DOWN: 1622>
3277
3408
  GAMEPAD_TOUCHPAD_MOTION: EventType # value = <EventType.GAMEPAD_TOUCHPAD_MOTION: 1623>
3278
3409
  GAMEPAD_TOUCHPAD_UP: EventType # value = <EventType.GAMEPAD_TOUCHPAD_UP: 1624>
3410
+ GAMEPAD_UPDATE_COMPLETE: EventType # value = <EventType.GAMEPAD_UPDATE_COMPLETE: 1626>
3279
3411
  KEYBOARD_ADDED: EventType # value = <EventType.KEYBOARD_ADDED: 773>
3280
3412
  KEYBOARD_REMOVED: EventType # value = <EventType.KEYBOARD_REMOVED: 774>
3413
+ KEYMAP_CHANGED: EventType # value = <EventType.KEYMAP_CHANGED: 772>
3281
3414
  KEY_DOWN: EventType # value = <EventType.KEY_DOWN: 768>
3282
3415
  KEY_UP: EventType # value = <EventType.KEY_UP: 769>
3283
3416
  K_0: Keycode # value = <Keycode.K_0: 48>
@@ -3292,12 +3425,16 @@ K_8: Keycode # value = <Keycode.K_8: 56>
3292
3425
  K_9: Keycode # value = <Keycode.K_9: 57>
3293
3426
  K_AGAIN: Keycode # value = <Keycode.K_AGAIN: 1073741945>
3294
3427
  K_AMPERSAND: Keycode # value = <Keycode.K_AMPERSAND: 38>
3428
+ K_APPLICATION: Keycode # value = <Keycode.K_APPLICATION: 1073741925>
3295
3429
  K_ASTERISK: Keycode # value = <Keycode.K_ASTERISK: 42>
3296
3430
  K_AT: Keycode # value = <Keycode.K_AT: 64>
3297
3431
  K_BACKSLASH: Keycode # value = <Keycode.K_BACKSLASH: 92>
3298
3432
  K_BACKSPACE: Keycode # value = <Keycode.K_BACKSPACE: 8>
3433
+ K_CALL: Keycode # value = <Keycode.K_CALL: 1073742113>
3299
3434
  K_CAPS: Keycode # value = <Keycode.K_CAPS: 1073741881>
3300
3435
  K_CARET: Keycode # value = <Keycode.K_CARET: 94>
3436
+ K_CHANNEL_DEC: Keycode # value = <Keycode.K_CHANNEL_DEC: 1073742085>
3437
+ K_CHANNEL_INC: Keycode # value = <Keycode.K_CHANNEL_INC: 1073742084>
3301
3438
  K_COLON: Keycode # value = <Keycode.K_COLON: 58>
3302
3439
  K_COMMA: Keycode # value = <Keycode.K_COMMA: 44>
3303
3440
  K_COPY: Keycode # value = <Keycode.K_COPY: 1073741948>
@@ -3307,13 +3444,18 @@ K_DEL: Keycode # value = <Keycode.K_DEL: 127>
3307
3444
  K_DOLLAR: Keycode # value = <Keycode.K_DOLLAR: 36>
3308
3445
  K_DOWN: Keycode # value = <Keycode.K_DOWN: 1073741905>
3309
3446
  K_END: Keycode # value = <Keycode.K_END: 1073741901>
3447
+ K_ENDCALL: Keycode # value = <Keycode.K_ENDCALL: 1073742114>
3310
3448
  K_EQ: Keycode # value = <Keycode.K_EQ: 61>
3311
3449
  K_ESC: Keycode # value = <Keycode.K_ESC: 27>
3312
3450
  K_EXCLAIM: Keycode # value = <Keycode.K_EXCLAIM: 33>
3451
+ K_EXECUTE: Keycode # value = <Keycode.K_EXECUTE: 1073741940>
3313
3452
  K_F1: Keycode # value = <Keycode.K_F1: 1073741882>
3314
3453
  K_F10: Keycode # value = <Keycode.K_F10: 1073741891>
3315
3454
  K_F11: Keycode # value = <Keycode.K_F11: 1073741892>
3316
3455
  K_F12: Keycode # value = <Keycode.K_F12: 1073741893>
3456
+ K_F13: Keycode # value = <Keycode.K_F13: 1073741928>
3457
+ K_F14: Keycode # value = <Keycode.K_F14: 1073741929>
3458
+ K_F15: Keycode # value = <Keycode.K_F15: 1073741930>
3317
3459
  K_F2: Keycode # value = <Keycode.K_F2: 1073741883>
3318
3460
  K_F3: Keycode # value = <Keycode.K_F3: 1073741884>
3319
3461
  K_F4: Keycode # value = <Keycode.K_F4: 1073741885>
@@ -3326,6 +3468,7 @@ K_FIND: Keycode # value = <Keycode.K_FIND: 1073741950>
3326
3468
  K_GRAVE: Keycode # value = <Keycode.K_GRAVE: 96>
3327
3469
  K_GT: Keycode # value = <Keycode.K_GT: 62>
3328
3470
  K_HASH: Keycode # value = <Keycode.K_HASH: 35>
3471
+ K_HELP: Keycode # value = <Keycode.K_HELP: 1073741941>
3329
3472
  K_HOME: Keycode # value = <Keycode.K_HOME: 1073741898>
3330
3473
  K_INS: Keycode # value = <Keycode.K_INS: 1073741897>
3331
3474
  K_KP_0: Keycode # value = <Keycode.K_KP_0: 1073741922>
@@ -3353,7 +3496,20 @@ K_LGUI: Keycode # value = <Keycode.K_LGUI: 1073742051>
3353
3496
  K_LPAREN: Keycode # value = <Keycode.K_LPAREN: 40>
3354
3497
  K_LSHIFT: Keycode # value = <Keycode.K_LSHIFT: 1073742049>
3355
3498
  K_LT: Keycode # value = <Keycode.K_LT: 60>
3499
+ K_MEDIA_EJECT: Keycode # value = <Keycode.K_MEDIA_EJECT: 1073742094>
3500
+ K_MEDIA_FF: Keycode # value = <Keycode.K_MEDIA_FF: 1073742089>
3501
+ K_MEDIA_NEXT: Keycode # value = <Keycode.K_MEDIA_NEXT: 1073742091>
3502
+ K_MEDIA_PAUSE: Keycode # value = <Keycode.K_MEDIA_PAUSE: 1073742087>
3503
+ K_MEDIA_PLAY: Keycode # value = <Keycode.K_MEDIA_PLAY: 1073742086>
3504
+ K_MEDIA_PLAY_PAUSE: Keycode # value = <Keycode.K_MEDIA_PLAY_PAUSE: 1073742095>
3505
+ K_MEDIA_PREV: Keycode # value = <Keycode.K_MEDIA_PREV: 1073742092>
3506
+ K_MEDIA_REC: Keycode # value = <Keycode.K_MEDIA_REC: 1073742088>
3507
+ K_MEDIA_REWIND: Keycode # value = <Keycode.K_MEDIA_REWIND: 1073742090>
3508
+ K_MEDIA_SELECT: Keycode # value = <Keycode.K_MEDIA_SELECT: 1073742096>
3509
+ K_MEDIA_STOP: Keycode # value = <Keycode.K_MEDIA_STOP: 1073742093>
3510
+ K_MENU: Keycode # value = <Keycode.K_MENU: 1073741942>
3356
3511
  K_MINUS: Keycode # value = <Keycode.K_MINUS: 45>
3512
+ K_MODE: Keycode # value = <Keycode.K_MODE: 1073742081>
3357
3513
  K_MUTE: Keycode # value = <Keycode.K_MUTE: 1073741951>
3358
3514
  K_NUMLOCK: Keycode # value = <Keycode.K_NUMLOCK: 1073741907>
3359
3515
  K_PASTE: Keycode # value = <Keycode.K_PASTE: 1073741949>
@@ -3364,6 +3520,7 @@ K_PGDOWN: Keycode # value = <Keycode.K_PGDOWN: 1073741902>
3364
3520
  K_PGUP: Keycode # value = <Keycode.K_PGUP: 1073741899>
3365
3521
  K_PIPE: Keycode # value = <Keycode.K_PIPE: 124>
3366
3522
  K_PLUS: Keycode # value = <Keycode.K_PLUS: 43>
3523
+ K_POWER: Keycode # value = <Keycode.K_POWER: 1073741926>
3367
3524
  K_PRTSCR: Keycode # value = <Keycode.K_PRTSCR: 1073741894>
3368
3525
  K_QUESTION: Keycode # value = <Keycode.K_QUESTION: 63>
3369
3526
  K_RALT: Keycode # value = <Keycode.K_RALT: 1073742054>
@@ -3376,17 +3533,24 @@ K_RIGHT: Keycode # value = <Keycode.K_RIGHT: 1073741903>
3376
3533
  K_RPAREN: Keycode # value = <Keycode.K_RPAREN: 41>
3377
3534
  K_RSHIFT: Keycode # value = <Keycode.K_RSHIFT: 1073742053>
3378
3535
  K_SCRLK: Keycode # value = <Keycode.K_SCRLK: 1073741895>
3536
+ K_SELECT: Keycode # value = <Keycode.K_SELECT: 1073741943>
3379
3537
  K_SEMICOLON: Keycode # value = <Keycode.K_SEMICOLON: 59>
3380
3538
  K_SGLQUOTE: Keycode # value = <Keycode.K_SGLQUOTE: 39>
3381
3539
  K_SLASH: Keycode # value = <Keycode.K_SLASH: 47>
3540
+ K_SLEEP: Keycode # value = <Keycode.K_SLEEP: 1073742082>
3541
+ K_SOFTLEFT: Keycode # value = <Keycode.K_SOFTLEFT: 1073742111>
3542
+ K_SOFTRIGHT: Keycode # value = <Keycode.K_SOFTRIGHT: 1073742112>
3382
3543
  K_SPACE: Keycode # value = <Keycode.K_SPACE: 32>
3544
+ K_STOP: Keycode # value = <Keycode.K_STOP: 1073741944>
3383
3545
  K_TAB: Keycode # value = <Keycode.K_TAB: 9>
3384
3546
  K_TILDE: Keycode # value = <Keycode.K_TILDE: 126>
3385
3547
  K_UNDERSCORE: Keycode # value = <Keycode.K_UNDERSCORE: 95>
3386
3548
  K_UNDO: Keycode # value = <Keycode.K_UNDO: 1073741946>
3549
+ K_UNKNOWN: Keycode # value = <Keycode.K_UNKNOWN: 0>
3387
3550
  K_UP: Keycode # value = <Keycode.K_UP: 1073741906>
3388
3551
  K_VOLDOWN: Keycode # value = <Keycode.K_VOLDOWN: 1073741953>
3389
3552
  K_VOLUP: Keycode # value = <Keycode.K_VOLUP: 1073741952>
3553
+ K_WAKE: Keycode # value = <Keycode.K_WAKE: 1073742083>
3390
3554
  K_a: Keycode # value = <Keycode.K_a: 97>
3391
3555
  K_b: Keycode # value = <Keycode.K_b: 98>
3392
3556
  K_c: Keycode # value = <Keycode.K_c: 99>
@@ -3413,8 +3577,8 @@ K_w: Keycode # value = <Keycode.K_w: 119>
3413
3577
  K_x: Keycode # value = <Keycode.K_x: 120>
3414
3578
  K_y: Keycode # value = <Keycode.K_y: 121>
3415
3579
  K_z: Keycode # value = <Keycode.K_z: 122>
3416
- MID_LEFT: Anchor # value = <Anchor.MID_LEFT: 3>
3417
- MID_RIGHT: Anchor # value = <Anchor.MID_RIGHT: 5>
3580
+ LOCALE_CHANGED: EventType # value = <EventType.LOCALE_CHANGED: 263>
3581
+ LOW_MEMORY: EventType # value = <EventType.LOW_MEMORY: 258>
3418
3582
  MOUSE_ADDED: EventType # value = <EventType.MOUSE_ADDED: 1028>
3419
3583
  MOUSE_BUTTON_DOWN: EventType # value = <EventType.MOUSE_BUTTON_DOWN: 1025>
3420
3584
  MOUSE_BUTTON_UP: EventType # value = <EventType.MOUSE_BUTTON_UP: 1026>
@@ -3442,6 +3606,11 @@ P_TANGENTIAL_PRESSURE: PenAxis # value = <PenAxis.P_TANGENTIAL_PRESSURE: 6>
3442
3606
  P_TILT_X: PenAxis # value = <PenAxis.P_TILT_X: 1>
3443
3607
  P_TILT_Y: PenAxis # value = <PenAxis.P_TILT_Y: 2>
3444
3608
  QUIT: EventType # value = <EventType.QUIT: 256>
3609
+ RENDER_DEVICE_LOST: EventType # value = <EventType.RENDER_DEVICE_LOST: 8194>
3610
+ RENDER_DEVICE_RESET: EventType # value = <EventType.RENDER_DEVICE_RESET: 8193>
3611
+ RENDER_TARGETS_RESET: EventType # value = <EventType.RENDER_TARGETS_RESET: 8192>
3612
+ SENSOR_UPDATE: EventType # value = <EventType.SENSOR_UPDATE: 4608>
3613
+ SYSTEM_THEME_CHANGED: EventType # value = <EventType.SYSTEM_THEME_CHANGED: 264>
3445
3614
  S_0: Scancode # value = <Scancode.S_0: 39>
3446
3615
  S_1: Scancode # value = <Scancode.S_1: 30>
3447
3616
  S_2: Scancode # value = <Scancode.S_2: 31>
@@ -3454,21 +3623,30 @@ S_8: Scancode # value = <Scancode.S_8: 37>
3454
3623
  S_9: Scancode # value = <Scancode.S_9: 38>
3455
3624
  S_AGAIN: Scancode # value = <Scancode.S_AGAIN: 121>
3456
3625
  S_APOSTROPHE: Scancode # value = <Scancode.S_APOSTROPHE: 52>
3626
+ S_APPLICATION: Scancode # value = <Scancode.S_APPLICATION: 101>
3457
3627
  S_BACKSLASH: Scancode # value = <Scancode.S_BACKSLASH: 49>
3458
3628
  S_BACKSPACE: Scancode # value = <Scancode.S_BACKSPACE: 42>
3629
+ S_CALL: Scancode # value = <Scancode.S_CALL: 289>
3459
3630
  S_CAPS: Scancode # value = <Scancode.S_CAPS: 57>
3631
+ S_CHANNEL_DEC: Scancode # value = <Scancode.S_CHANNEL_DEC: 261>
3632
+ S_CHANNEL_INC: Scancode # value = <Scancode.S_CHANNEL_INC: 260>
3460
3633
  S_COMMA: Scancode # value = <Scancode.S_COMMA: 54>
3461
3634
  S_COPY: Scancode # value = <Scancode.S_COPY: 124>
3462
3635
  S_CUT: Scancode # value = <Scancode.S_CUT: 123>
3463
3636
  S_DEL: Scancode # value = <Scancode.S_DEL: 76>
3464
3637
  S_DOWN: Scancode # value = <Scancode.S_DOWN: 81>
3465
3638
  S_END: Scancode # value = <Scancode.S_END: 77>
3639
+ S_ENDCALL: Scancode # value = <Scancode.S_ENDCALL: 290>
3466
3640
  S_EQ: Scancode # value = <Scancode.S_EQ: 46>
3467
3641
  S_ESC: Scancode # value = <Scancode.S_ESC: 41>
3642
+ S_EXECUTE: Scancode # value = <Scancode.S_EXECUTE: 116>
3468
3643
  S_F1: Scancode # value = <Scancode.S_F1: 58>
3469
3644
  S_F10: Scancode # value = <Scancode.S_F10: 67>
3470
3645
  S_F11: Scancode # value = <Scancode.S_F11: 68>
3471
3646
  S_F12: Scancode # value = <Scancode.S_F12: 69>
3647
+ S_F13: Scancode # value = <Scancode.S_F13: 104>
3648
+ S_F14: Scancode # value = <Scancode.S_F14: 105>
3649
+ S_F15: Scancode # value = <Scancode.S_F15: 106>
3472
3650
  S_F2: Scancode # value = <Scancode.S_F2: 59>
3473
3651
  S_F3: Scancode # value = <Scancode.S_F3: 60>
3474
3652
  S_F4: Scancode # value = <Scancode.S_F4: 61>
@@ -3479,6 +3657,7 @@ S_F8: Scancode # value = <Scancode.S_F8: 65>
3479
3657
  S_F9: Scancode # value = <Scancode.S_F9: 66>
3480
3658
  S_FIND: Scancode # value = <Scancode.S_FIND: 126>
3481
3659
  S_GRAVE: Scancode # value = <Scancode.S_GRAVE: 53>
3660
+ S_HELP: Scancode # value = <Scancode.S_HELP: 117>
3482
3661
  S_HOME: Scancode # value = <Scancode.S_HOME: 74>
3483
3662
  S_INS: Scancode # value = <Scancode.S_INS: 73>
3484
3663
  S_KP_0: Scancode # value = <Scancode.S_KP_0: 98>
@@ -3503,7 +3682,20 @@ S_LCTRL: Scancode # value = <Scancode.S_LCTRL: 224>
3503
3682
  S_LEFT: Scancode # value = <Scancode.S_LEFT: 80>
3504
3683
  S_LGUI: Scancode # value = <Scancode.S_LGUI: 227>
3505
3684
  S_LSHIFT: Scancode # value = <Scancode.S_LSHIFT: 225>
3685
+ S_MEDIA_EJECT: Scancode # value = <Scancode.S_MEDIA_EJECT: 270>
3686
+ S_MEDIA_FAST_FORWARD: Scancode # value = <Scancode.S_MEDIA_FAST_FORWARD: 265>
3687
+ S_MEDIA_NEXT: Scancode # value = <Scancode.S_MEDIA_NEXT: 267>
3688
+ S_MEDIA_PAUSE: Scancode # value = <Scancode.S_MEDIA_PAUSE: 263>
3689
+ S_MEDIA_PLAY: Scancode # value = <Scancode.S_MEDIA_PLAY: 262>
3690
+ S_MEDIA_PLAY_PAUSE: Scancode # value = <Scancode.S_MEDIA_PLAY_PAUSE: 271>
3691
+ S_MEDIA_PREV: Scancode # value = <Scancode.S_MEDIA_PREV: 268>
3692
+ S_MEDIA_REC: Scancode # value = <Scancode.S_MEDIA_REC: 264>
3693
+ S_MEDIA_REWIND: Scancode # value = <Scancode.S_MEDIA_REWIND: 266>
3694
+ S_MEDIA_SELECT: Scancode # value = <Scancode.S_MEDIA_SELECT: 272>
3695
+ S_MEDIA_STOP: Scancode # value = <Scancode.S_MEDIA_STOP: 269>
3696
+ S_MENU: Scancode # value = <Scancode.S_MENU: 118>
3506
3697
  S_MINUS: Scancode # value = <Scancode.S_MINUS: 45>
3698
+ S_MODE: Scancode # value = <Scancode.S_MODE: 257>
3507
3699
  S_MUTE: Scancode # value = <Scancode.S_MUTE: 127>
3508
3700
  S_NUMLOCK: Scancode # value = <Scancode.S_NUMLOCK: 83>
3509
3701
  S_PASTE: Scancode # value = <Scancode.S_PASTE: 125>
@@ -3511,6 +3703,7 @@ S_PAUSE: Scancode # value = <Scancode.S_PAUSE: 72>
3511
3703
  S_PERIOD: Scancode # value = <Scancode.S_PERIOD: 55>
3512
3704
  S_PGDOWN: Scancode # value = <Scancode.S_PGDOWN: 78>
3513
3705
  S_PGUP: Scancode # value = <Scancode.S_PGUP: 75>
3706
+ S_POWER: Scancode # value = <Scancode.S_POWER: 102>
3514
3707
  S_PRTSCR: Scancode # value = <Scancode.S_PRTSCR: 70>
3515
3708
  S_RALT: Scancode # value = <Scancode.S_RALT: 230>
3516
3709
  S_RBRACKET: Scancode # value = <Scancode.S_RBRACKET: 48>
@@ -3520,14 +3713,20 @@ S_RGUI: Scancode # value = <Scancode.S_RGUI: 231>
3520
3713
  S_RIGHT: Scancode # value = <Scancode.S_RIGHT: 79>
3521
3714
  S_RSHIFT: Scancode # value = <Scancode.S_RSHIFT: 229>
3522
3715
  S_SCRLK: Scancode # value = <Scancode.S_SCRLK: 71>
3716
+ S_SELECT: Scancode # value = <Scancode.S_SELECT: 119>
3523
3717
  S_SEMICOLON: Scancode # value = <Scancode.S_SEMICOLON: 51>
3524
3718
  S_SLASH: Scancode # value = <Scancode.S_SLASH: 56>
3719
+ S_SLEEP: Scancode # value = <Scancode.S_SLEEP: 258>
3720
+ S_SOFTLEFT: Scancode # value = <Scancode.S_SOFTLEFT: 287>
3721
+ S_SOFTRIGHT: Scancode # value = <Scancode.S_SOFTRIGHT: 288>
3525
3722
  S_SPACE: Scancode # value = <Scancode.S_SPACE: 44>
3723
+ S_STOP: Scancode # value = <Scancode.S_STOP: 120>
3526
3724
  S_TAB: Scancode # value = <Scancode.S_TAB: 43>
3527
3725
  S_UNDO: Scancode # value = <Scancode.S_UNDO: 122>
3528
3726
  S_UP: Scancode # value = <Scancode.S_UP: 82>
3529
3727
  S_VOLDOWN: Scancode # value = <Scancode.S_VOLDOWN: 129>
3530
3728
  S_VOLUP: Scancode # value = <Scancode.S_VOLUP: 128>
3729
+ S_WAKE: Scancode # value = <Scancode.S_WAKE: 259>
3531
3730
  S_a: Scancode # value = <Scancode.S_a: 4>
3532
3731
  S_b: Scancode # value = <Scancode.S_b: 5>
3533
3732
  S_c: Scancode # value = <Scancode.S_c: 6>
@@ -3554,16 +3753,24 @@ S_w: Scancode # value = <Scancode.S_w: 26>
3554
3753
  S_x: Scancode # value = <Scancode.S_x: 27>
3555
3754
  S_y: Scancode # value = <Scancode.S_y: 28>
3556
3755
  S_z: Scancode # value = <Scancode.S_z: 29>
3756
+ TERMINATING: EventType # value = <EventType.TERMINATING: 257>
3557
3757
  TEXT_EDITING: EventType # value = <EventType.TEXT_EDITING: 770>
3758
+ TEXT_EDITING_CANDIDATES: EventType # value = <EventType.TEXT_EDITING_CANDIDATES: 775>
3558
3759
  TEXT_INPUT: EventType # value = <EventType.TEXT_INPUT: 771>
3559
- TOP_LEFT: Anchor # value = <Anchor.TOP_LEFT: 0>
3560
- TOP_MID: Anchor # value = <Anchor.TOP_MID: 1>
3561
- TOP_RIGHT: Anchor # value = <Anchor.TOP_RIGHT: 2>
3760
+ WILL_ENTER_BACKGROUND: EventType # value = <EventType.WILL_ENTER_BACKGROUND: 259>
3761
+ WILL_ENTER_FOREGROUND: EventType # value = <EventType.WILL_ENTER_FOREGROUND: 261>
3762
+ WINDOW_CLOSE_REQUESTED: EventType # value = <EventType.WINDOW_CLOSE_REQUESTED: 528>
3763
+ WINDOW_DESTROYED: EventType # value = <EventType.WINDOW_DESTROYED: 537>
3764
+ WINDOW_DISPLAY_CHANGED: EventType # value = <EventType.WINDOW_DISPLAY_CHANGED: 531>
3765
+ WINDOW_DISPLAY_SCALE_CHANGED: EventType # value = <EventType.WINDOW_DISPLAY_SCALE_CHANGED: 532>
3562
3766
  WINDOW_ENTER_FULLSCREEN: EventType # value = <EventType.WINDOW_ENTER_FULLSCREEN: 535>
3563
3767
  WINDOW_EXPOSED: EventType # value = <EventType.WINDOW_EXPOSED: 516>
3564
3768
  WINDOW_FOCUS_GAINED: EventType # value = <EventType.WINDOW_FOCUS_GAINED: 526>
3565
3769
  WINDOW_FOCUS_LOST: EventType # value = <EventType.WINDOW_FOCUS_LOST: 527>
3770
+ WINDOW_HDR_STATE_CHANGED: EventType # value = <EventType.WINDOW_HDR_STATE_CHANGED: 538>
3566
3771
  WINDOW_HIDDEN: EventType # value = <EventType.WINDOW_HIDDEN: 515>
3772
+ WINDOW_HIT_TEST: EventType # value = <EventType.WINDOW_HIT_TEST: 529>
3773
+ WINDOW_ICCPROF_CHANGED: EventType # value = <EventType.WINDOW_ICCPROF_CHANGED: 530>
3567
3774
  WINDOW_LEAVE_FULLSCREEN: EventType # value = <EventType.WINDOW_LEAVE_FULLSCREEN: 536>
3568
3775
  WINDOW_MAXIMIZED: EventType # value = <EventType.WINDOW_MAXIMIZED: 522>
3569
3776
  WINDOW_MINIMIZED: EventType # value = <EventType.WINDOW_MINIMIZED: 521>
@@ -3573,4 +3780,5 @@ WINDOW_MOVED: EventType # value = <EventType.WINDOW_MOVED: 517>
3573
3780
  WINDOW_OCCLUDED: EventType # value = <EventType.WINDOW_OCCLUDED: 534>
3574
3781
  WINDOW_RESIZED: EventType # value = <EventType.WINDOW_RESIZED: 518>
3575
3782
  WINDOW_RESTORED: EventType # value = <EventType.WINDOW_RESTORED: 523>
3783
+ WINDOW_SAFE_AREA_CHANGED: EventType # value = <EventType.WINDOW_SAFE_AREA_CHANGED: 533>
3576
3784
  WINDOW_SHOWN: EventType # value = <EventType.WINDOW_SHOWN: 514>