kraken-engine 1.1.1__cp313-cp313-win_amd64.whl → 1.3.0__cp313-cp313-win_amd64.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.
- {kraken_engine-1.1.1.dist-info → kraken_engine-1.3.0.dist-info}/METADATA +2 -1
- kraken_engine-1.3.0.dist-info/RECORD +28 -0
- pykraken/__init__.pyi +7 -10
- pykraken/_core/__init__.pyi +640 -672
- pykraken/_core/collision.pyi +105 -57
- pykraken/_core/event.pyi +46 -1
- pykraken/_core/math.pyi +14 -3
- pykraken/_core/time.pyi +4 -4
- pykraken/_core/viewport.pyi +30 -0
- pykraken/_core/window.pyi +10 -9
- pykraken/_core.cp313-win_amd64.pyd +0 -0
- pykraken/shader_uniform.py +16 -24
- pykraken/shader_uniform.pyi +13 -21
- kraken_engine-1.1.1.dist-info/RECORD +0 -27
- {kraken_engine-1.1.1.dist-info → kraken_engine-1.3.0.dist-info}/WHEEL +0 -0
- {kraken_engine-1.1.1.dist-info → kraken_engine-1.3.0.dist-info}/licenses/LICENSE +0 -0
pykraken/_core/__init__.pyi
CHANGED
|
@@ -17,8 +17,20 @@ from . import rect
|
|
|
17
17
|
from . import renderer
|
|
18
18
|
from . import time
|
|
19
19
|
from . import transform
|
|
20
|
+
from . import viewport
|
|
20
21
|
from . import window
|
|
21
|
-
__all__: list[str] = ['AUDIO_DEVICE_ADDED', 'AUDIO_DEVICE_FORMAT_CHANGED', 'AUDIO_DEVICE_REMOVED', 'Anchor', 'Animation', 'AnimationController', 'Audio', 'AudioStream', '
|
|
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
|
+
"""
|
|
22
34
|
class Anchor(enum.IntEnum):
|
|
23
35
|
BOTTOM_LEFT: typing.ClassVar[Anchor] # value = <Anchor.BOTTOM_LEFT: 6>
|
|
24
36
|
BOTTOM_MID: typing.ClassVar[Anchor] # value = <Anchor.BOTTOM_MID: 7>
|
|
@@ -76,37 +88,27 @@ class AnimationController:
|
|
|
76
88
|
Returns:
|
|
77
89
|
bool: True if the animation completed a loop during the last update.
|
|
78
90
|
"""
|
|
79
|
-
def
|
|
80
|
-
"""
|
|
81
|
-
Load animation frames from a directory of image files.
|
|
82
|
-
|
|
83
|
-
Loads all valid image files from the specified directory as animation frames.
|
|
84
|
-
Supported formats include PNG, JPG, JPEG, BMP, TGA, and GIF.
|
|
85
|
-
|
|
86
|
-
Args:
|
|
87
|
-
name (str): Unique identifier for the animation.
|
|
88
|
-
dir_path (str): Path to the directory containing image files.
|
|
89
|
-
fps (int): Frames per second for playback timing.
|
|
90
|
-
|
|
91
|
-
Raises:
|
|
92
|
-
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:
|
|
93
92
|
"""
|
|
94
|
-
|
|
95
|
-
"""
|
|
96
|
-
Load animation frames from a sprite sheet texture.
|
|
93
|
+
Load one or more animations from a sprite sheet texture.
|
|
97
94
|
|
|
98
|
-
Divides the sprite sheet into
|
|
99
|
-
|
|
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.
|
|
100
98
|
|
|
101
99
|
Args:
|
|
102
|
-
name (str): Unique identifier for the animation.
|
|
103
100
|
file_path (str): Path to the sprite sheet image file.
|
|
104
101
|
frame_size (Vec2): Size of each frame as (width, height).
|
|
105
|
-
|
|
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
|
|
106
106
|
|
|
107
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.
|
|
108
110
|
RuntimeError: If sprite sheet dimensions are not divisible by frame dimensions,
|
|
109
|
-
or
|
|
111
|
+
duplicate animation names exist, or strip index exceeds sprite sheet height.
|
|
110
112
|
"""
|
|
111
113
|
def pause(self) -> None:
|
|
112
114
|
"""
|
|
@@ -114,16 +116,30 @@ class AnimationController:
|
|
|
114
116
|
|
|
115
117
|
Stops animation frame advancement while preserving the current frame position.
|
|
116
118
|
"""
|
|
117
|
-
def
|
|
119
|
+
def play(self, name: str) -> None:
|
|
118
120
|
"""
|
|
119
|
-
|
|
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.
|
|
120
137
|
|
|
121
138
|
Args:
|
|
122
|
-
|
|
139
|
+
frame_index (int): The frame index to start from (0-based).
|
|
123
140
|
|
|
124
|
-
|
|
125
|
-
If the
|
|
126
|
-
without a current animation.
|
|
141
|
+
Raises:
|
|
142
|
+
IndexError: If the frame index is out of range for the current animation.
|
|
127
143
|
"""
|
|
128
144
|
def resume(self) -> None:
|
|
129
145
|
"""
|
|
@@ -138,15 +154,15 @@ class AnimationController:
|
|
|
138
154
|
|
|
139
155
|
Sets the animation back to frame 0 and resets loop detection state.
|
|
140
156
|
"""
|
|
141
|
-
def set(self, name: str
|
|
157
|
+
def set(self, name: str) -> None:
|
|
142
158
|
"""
|
|
143
|
-
Set the current active animation by name.
|
|
159
|
+
Set the current active animation by name without affecting playback state.
|
|
144
160
|
|
|
145
|
-
Switches to the specified animation
|
|
161
|
+
Switches to the specified animation while preserving the current frame index and
|
|
162
|
+
playback state (paused/playing). Useful for seamless animation transitions.
|
|
146
163
|
|
|
147
164
|
Args:
|
|
148
165
|
name (str): The name of the animation to activate.
|
|
149
|
-
rewind (bool): Whether to rewind the animation to the start.
|
|
150
166
|
|
|
151
167
|
Raises:
|
|
152
168
|
ValueError: If the specified animation name is not found.
|
|
@@ -171,6 +187,27 @@ class AnimationController:
|
|
|
171
187
|
RuntimeError: If no animation is currently set or the animation has no frames.
|
|
172
188
|
"""
|
|
173
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
|
|
174
211
|
def playback_speed(self) -> float:
|
|
175
212
|
"""
|
|
176
213
|
The playback speed multiplier for animation timing.
|
|
@@ -184,6 +221,18 @@ class AnimationController:
|
|
|
184
221
|
@playback_speed.setter
|
|
185
222
|
def playback_speed(self, arg1: typing.SupportsFloat) -> None:
|
|
186
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
|
+
"""
|
|
187
236
|
class Audio:
|
|
188
237
|
"""
|
|
189
238
|
|
|
@@ -269,16 +318,17 @@ class AudioStream:
|
|
|
269
318
|
|
|
270
319
|
The stream position is preserved and can be resumed with resume().
|
|
271
320
|
"""
|
|
272
|
-
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:
|
|
273
322
|
"""
|
|
274
|
-
Play the audio stream with optional fade-in time and
|
|
323
|
+
Play the audio stream with optional fade-in time, loop setting, and start position.
|
|
275
324
|
|
|
276
|
-
|
|
277
|
-
playing, it will restart from the
|
|
325
|
+
Starts playback from the specified time position. If the stream is already
|
|
326
|
+
playing, it will restart from the specified position.
|
|
278
327
|
|
|
279
328
|
Args:
|
|
280
329
|
fade_in_ms (int, optional): Fade-in duration in milliseconds. Defaults to 0.
|
|
281
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.
|
|
282
332
|
"""
|
|
283
333
|
def resume(self) -> None:
|
|
284
334
|
"""
|
|
@@ -293,6 +343,16 @@ class AudioStream:
|
|
|
293
343
|
Sets the playback position back to the start of the audio file. Does not affect
|
|
294
344
|
the current play state (playing/paused).
|
|
295
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
|
+
"""
|
|
296
356
|
def set_looping(self, loop: bool) -> None:
|
|
297
357
|
"""
|
|
298
358
|
Set whether the audio stream loops continuously.
|
|
@@ -309,6 +369,11 @@ class AudioStream:
|
|
|
309
369
|
If > 0, fades out over the specified duration. Defaults to 0.
|
|
310
370
|
"""
|
|
311
371
|
@property
|
|
372
|
+
def current_time(self) -> float:
|
|
373
|
+
"""
|
|
374
|
+
The current playback time position in seconds.
|
|
375
|
+
"""
|
|
376
|
+
@property
|
|
312
377
|
def volume(self) -> float:
|
|
313
378
|
"""
|
|
314
379
|
The volume level of the audio stream.
|
|
@@ -383,13 +448,9 @@ class Circle:
|
|
|
383
448
|
"""
|
|
384
449
|
__hash__: typing.ClassVar[None] = None
|
|
385
450
|
def __eq__(self, other: Circle) -> bool:
|
|
386
|
-
|
|
387
|
-
Check if two circles are equal.
|
|
388
|
-
"""
|
|
451
|
+
...
|
|
389
452
|
def __getitem__(self, index: typing.SupportsInt) -> float:
|
|
390
|
-
|
|
391
|
-
Get component by index: 0 = x, 1 = y, 2 = radius.
|
|
392
|
-
"""
|
|
453
|
+
...
|
|
393
454
|
@typing.overload
|
|
394
455
|
def __init__(self, pos: Vec2, radius: typing.SupportsFloat) -> None:
|
|
395
456
|
"""
|
|
@@ -405,17 +466,11 @@ class Circle:
|
|
|
405
466
|
Create a circle from a nested sequence: ([x, y], radius).
|
|
406
467
|
"""
|
|
407
468
|
def __iter__(self) -> collections.abc.Iterator:
|
|
408
|
-
|
|
409
|
-
Return an iterator over (x, y, radius).
|
|
410
|
-
"""
|
|
469
|
+
...
|
|
411
470
|
def __len__(self) -> int:
|
|
412
|
-
|
|
413
|
-
Always returns 3 for (x, y, radius).
|
|
414
|
-
"""
|
|
471
|
+
...
|
|
415
472
|
def __ne__(self, other: Circle) -> bool:
|
|
416
|
-
|
|
417
|
-
Check if two circles are not equal.
|
|
418
|
-
"""
|
|
473
|
+
...
|
|
419
474
|
def as_rect(self) -> Rect:
|
|
420
475
|
"""
|
|
421
476
|
Return the smallest rectangle that fully contains the circle.
|
|
@@ -460,28 +515,9 @@ class Color:
|
|
|
460
515
|
"""
|
|
461
516
|
__hash__: typing.ClassVar[None] = None
|
|
462
517
|
def __eq__(self, other: Color) -> bool:
|
|
463
|
-
|
|
464
|
-
Check if two Color objects are equal (all RGBA components match).
|
|
465
|
-
|
|
466
|
-
Args:
|
|
467
|
-
other (Color): The color to compare with.
|
|
468
|
-
|
|
469
|
-
Returns:
|
|
470
|
-
bool: True if colors are identical, False otherwise.
|
|
471
|
-
"""
|
|
518
|
+
...
|
|
472
519
|
def __getitem__(self, index: typing.SupportsInt) -> int:
|
|
473
|
-
|
|
474
|
-
Access color channels by index.
|
|
475
|
-
|
|
476
|
-
Args:
|
|
477
|
-
index (int): Channel index (0=r, 1=g, 2=b, 3=a).
|
|
478
|
-
|
|
479
|
-
Returns:
|
|
480
|
-
int: Channel value (0-255).
|
|
481
|
-
|
|
482
|
-
Raises:
|
|
483
|
-
IndexError: If index is not in range [0, 3].
|
|
484
|
-
"""
|
|
520
|
+
...
|
|
485
521
|
@typing.overload
|
|
486
522
|
def __init__(self) -> None:
|
|
487
523
|
"""
|
|
@@ -517,113 +553,25 @@ class Color:
|
|
|
517
553
|
- 4 values: RGBA
|
|
518
554
|
"""
|
|
519
555
|
def __iter__(self) -> collections.abc.Iterator:
|
|
520
|
-
|
|
521
|
-
Return an iterator over color channels.
|
|
522
|
-
|
|
523
|
-
Yields:
|
|
524
|
-
int: The r, g, b, a values in that order (0-255 each).
|
|
525
|
-
|
|
526
|
-
Example:
|
|
527
|
-
for channel in color:
|
|
528
|
-
print(channel) # Prints r, g, b, a values
|
|
529
|
-
"""
|
|
556
|
+
...
|
|
530
557
|
def __len__(self) -> int:
|
|
531
|
-
|
|
532
|
-
Return the number of color channels.
|
|
533
|
-
|
|
534
|
-
Returns:
|
|
535
|
-
int: Always returns 4 (for r, g, b, a channels).
|
|
536
|
-
"""
|
|
558
|
+
...
|
|
537
559
|
def __mul__(self, scalar: typing.SupportsFloat) -> Color:
|
|
538
|
-
|
|
539
|
-
Multiply RGB color channels by a scalar value.
|
|
540
|
-
|
|
541
|
-
Multiplies each RGB component by the scalar. Results are clamped to [0, 255].
|
|
542
|
-
The alpha channel is preserved unchanged.
|
|
543
|
-
Negative scalars invert the color before applying the absolute value.
|
|
544
|
-
|
|
545
|
-
Args:
|
|
546
|
-
scalar (float): Scalar multiplier (any positive or negative value).
|
|
547
|
-
|
|
548
|
-
Returns:
|
|
549
|
-
Color: New Color with scaled RGB values and original alpha.
|
|
550
|
-
"""
|
|
560
|
+
...
|
|
551
561
|
def __ne__(self, other: Color) -> bool:
|
|
552
|
-
|
|
553
|
-
Check if two Color objects are not equal.
|
|
554
|
-
|
|
555
|
-
Args:
|
|
556
|
-
other (Color): The color to compare with.
|
|
557
|
-
|
|
558
|
-
Returns:
|
|
559
|
-
bool: True if any component differs, False otherwise.
|
|
560
|
-
"""
|
|
562
|
+
...
|
|
561
563
|
def __neg__(self) -> Color:
|
|
562
|
-
|
|
563
|
-
Unary negation operator to invert the color.
|
|
564
|
-
|
|
565
|
-
Returns the inverted color by flipping RGB channels (255 - value).
|
|
566
|
-
The alpha channel is preserved unchanged.
|
|
567
|
-
|
|
568
|
-
Returns:
|
|
569
|
-
Color: New Color with inverted RGB values and original alpha.
|
|
570
|
-
"""
|
|
564
|
+
...
|
|
571
565
|
def __repr__(self) -> str:
|
|
572
|
-
|
|
573
|
-
Return a string suitable for debugging and recreation.
|
|
574
|
-
|
|
575
|
-
Returns:
|
|
576
|
-
str: String in format "Color(r, g, b, a)" that can recreate the object.
|
|
577
|
-
"""
|
|
566
|
+
...
|
|
578
567
|
def __rmul__(self, scalar: typing.SupportsFloat) -> Color:
|
|
579
|
-
|
|
580
|
-
Multiply RGB color channels by a scalar value (reverse multiplication).
|
|
581
|
-
|
|
582
|
-
Allows scalar * color syntax in addition to color * scalar.
|
|
583
|
-
Results are clamped to [0, 255]. The alpha channel is preserved unchanged.
|
|
584
|
-
Negative scalars invert the color before applying the absolute value.
|
|
585
|
-
|
|
586
|
-
Args:
|
|
587
|
-
scalar (float): Scalar multiplier (any positive or negative value).
|
|
588
|
-
|
|
589
|
-
Returns:
|
|
590
|
-
Color: New Color with scaled RGB values and original alpha.
|
|
591
|
-
"""
|
|
568
|
+
...
|
|
592
569
|
def __setitem__(self, index: typing.SupportsInt, value: typing.SupportsInt) -> None:
|
|
593
|
-
|
|
594
|
-
Set a color channel by index.
|
|
595
|
-
|
|
596
|
-
Args:
|
|
597
|
-
index (int): Channel index (0=r, 1=g, 2=b, 3=a).
|
|
598
|
-
value (int): New channel value (0-255).
|
|
599
|
-
|
|
600
|
-
Raises:
|
|
601
|
-
IndexError: If index is not in range [0, 3].
|
|
602
|
-
"""
|
|
570
|
+
...
|
|
603
571
|
def __str__(self) -> str:
|
|
604
|
-
|
|
605
|
-
Return a human-readable string representation.
|
|
606
|
-
|
|
607
|
-
Returns:
|
|
608
|
-
str: String in format "(r, g, b, a)" with integer values.
|
|
609
|
-
"""
|
|
572
|
+
...
|
|
610
573
|
def __truediv__(self, scalar: typing.SupportsFloat) -> Color:
|
|
611
|
-
|
|
612
|
-
Divide RGB color channels by a scalar value.
|
|
613
|
-
|
|
614
|
-
Divides each RGB component by the scalar. Results are clamped to [0, 255].
|
|
615
|
-
The alpha channel is preserved unchanged.
|
|
616
|
-
Negative scalars invert the color before applying the absolute value.
|
|
617
|
-
|
|
618
|
-
Args:
|
|
619
|
-
scalar (float): Scalar divisor (any positive or negative value except 0).
|
|
620
|
-
|
|
621
|
-
Returns:
|
|
622
|
-
Color: New Color with divided RGB values and original alpha.
|
|
623
|
-
|
|
624
|
-
Raises:
|
|
625
|
-
ValueError: If scalar is zero.
|
|
626
|
-
"""
|
|
574
|
+
...
|
|
627
575
|
def copy(self) -> Color:
|
|
628
576
|
"""
|
|
629
577
|
Create a copy of the color.
|
|
@@ -769,17 +717,7 @@ class Event:
|
|
|
769
717
|
|
|
770
718
|
"""
|
|
771
719
|
def __getattr__(self, arg0: str) -> typing.Any:
|
|
772
|
-
|
|
773
|
-
Dynamically access event attributes.
|
|
774
|
-
|
|
775
|
-
Examples:
|
|
776
|
-
event.key
|
|
777
|
-
event.button
|
|
778
|
-
event.pos
|
|
779
|
-
|
|
780
|
-
Raises:
|
|
781
|
-
AttributeError: If the requested attribute doesn't exist.
|
|
782
|
-
"""
|
|
720
|
+
...
|
|
783
721
|
@property
|
|
784
722
|
def type(self) -> int:
|
|
785
723
|
"""
|
|
@@ -890,11 +828,11 @@ class EventType(enum.IntEnum):
|
|
|
890
828
|
class Font:
|
|
891
829
|
"""
|
|
892
830
|
|
|
893
|
-
A font
|
|
831
|
+
A font typeface for rendering text.
|
|
894
832
|
|
|
895
|
-
This class wraps an SDL_ttf font and
|
|
896
|
-
|
|
897
|
-
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:
|
|
898
836
|
|
|
899
837
|
- "kraken-clean": A clean sans-serif font bundled with the engine.
|
|
900
838
|
- "kraken-retro": A pixel/retro font bundled with the engine. Point size is
|
|
@@ -905,7 +843,7 @@ class Font:
|
|
|
905
843
|
call kn.window.create(...) first, which initializes the font engine.
|
|
906
844
|
|
|
907
845
|
"""
|
|
908
|
-
def __init__(self,
|
|
846
|
+
def __init__(self, file_dir: str, pt_size: typing.SupportsInt) -> None:
|
|
909
847
|
"""
|
|
910
848
|
Create a Font.
|
|
911
849
|
|
|
@@ -919,69 +857,135 @@ class Font:
|
|
|
919
857
|
Raises:
|
|
920
858
|
RuntimeError: If the font fails to load.
|
|
921
859
|
"""
|
|
922
|
-
|
|
860
|
+
@property
|
|
861
|
+
def alignment(self) -> Align:
|
|
923
862
|
"""
|
|
924
|
-
|
|
863
|
+
Get or set the text alignment for wrapped text.
|
|
925
864
|
|
|
926
|
-
|
|
927
|
-
text (str): The text to render.
|
|
928
|
-
pos (Vec2 | None, optional): The position in pixels. Defaults to (0, 0).
|
|
929
|
-
color (Color | None, optional): Text color. Defaults to white.
|
|
930
|
-
wrap_width (int, optional): Wrap the text at this pixel width. Set to 0 for
|
|
931
|
-
no wrapping. Defaults to 0.
|
|
932
|
-
|
|
933
|
-
Returns:
|
|
934
|
-
None
|
|
865
|
+
Valid values: Align.LEFT, Align.CENTER, Align.RIGHT
|
|
935
866
|
"""
|
|
936
|
-
|
|
867
|
+
@alignment.setter
|
|
868
|
+
def alignment(self, arg1: Align) -> None:
|
|
869
|
+
...
|
|
870
|
+
@property
|
|
871
|
+
def ascent(self) -> int:
|
|
937
872
|
"""
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
Args:
|
|
941
|
-
on (bool): True to enable bold, False to disable.
|
|
873
|
+
Get the pixel ascent of the font.
|
|
942
874
|
|
|
943
875
|
Returns:
|
|
944
|
-
|
|
876
|
+
int: The font ascent in pixels.
|
|
945
877
|
"""
|
|
946
|
-
|
|
878
|
+
@property
|
|
879
|
+
def bold(self) -> bool:
|
|
947
880
|
"""
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
Args:
|
|
951
|
-
on (bool): True to enable italic, False to disable.
|
|
952
|
-
|
|
953
|
-
Returns:
|
|
954
|
-
None
|
|
881
|
+
Get or set whether bold text style is enabled.
|
|
955
882
|
"""
|
|
956
|
-
|
|
883
|
+
@bold.setter
|
|
884
|
+
def bold(self, arg1: bool) -> None:
|
|
885
|
+
...
|
|
886
|
+
@property
|
|
887
|
+
def descent(self) -> int:
|
|
957
888
|
"""
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
Args:
|
|
961
|
-
pt (int): The new point size. Values below 8 are clamped to 8.
|
|
889
|
+
Get the pixel descent of the font.
|
|
962
890
|
|
|
963
891
|
Returns:
|
|
964
|
-
|
|
892
|
+
int: The font descent in pixels.
|
|
965
893
|
"""
|
|
966
|
-
|
|
894
|
+
@property
|
|
895
|
+
def height(self) -> int:
|
|
967
896
|
"""
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
Args:
|
|
971
|
-
on (bool): True to enable strikethrough, False to disable.
|
|
897
|
+
Get the maximum pixel height of all glyphs in the font.
|
|
972
898
|
|
|
973
899
|
Returns:
|
|
974
|
-
|
|
900
|
+
int: The font height in pixels.
|
|
975
901
|
"""
|
|
976
|
-
|
|
902
|
+
@property
|
|
903
|
+
def hinting(self) -> FontHint:
|
|
977
904
|
"""
|
|
978
|
-
|
|
905
|
+
Get or set the font hinting mode.
|
|
979
906
|
|
|
980
|
-
|
|
981
|
-
|
|
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.
|
|
982
976
|
|
|
983
|
-
|
|
984
|
-
|
|
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.
|
|
985
989
|
"""
|
|
986
990
|
class Frame:
|
|
987
991
|
"""
|
|
@@ -1287,23 +1291,9 @@ class Line:
|
|
|
1287
1291
|
"""
|
|
1288
1292
|
__hash__: typing.ClassVar[None] = None
|
|
1289
1293
|
def __eq__(self, other: Line) -> bool:
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
Args:
|
|
1294
|
-
other (Line): The other line to compare.
|
|
1295
|
-
|
|
1296
|
-
Returns:
|
|
1297
|
-
bool: True if all components are equal.
|
|
1298
|
-
"""
|
|
1299
|
-
def __getitem__(self, arg0: typing.SupportsInt) -> float:
|
|
1300
|
-
"""
|
|
1301
|
-
Get coordinate by index:
|
|
1302
|
-
0 = ax, 1 = ay, 2 = bx, 3 = by
|
|
1303
|
-
|
|
1304
|
-
Raises:
|
|
1305
|
-
IndexError: If index is not 0-3.
|
|
1306
|
-
"""
|
|
1294
|
+
...
|
|
1295
|
+
def __getitem__(self, index: typing.SupportsInt) -> float:
|
|
1296
|
+
...
|
|
1307
1297
|
@typing.overload
|
|
1308
1298
|
def __init__(self) -> None:
|
|
1309
1299
|
"""
|
|
@@ -1360,22 +1350,9 @@ class Line:
|
|
|
1360
1350
|
def __iter__(self) -> collections.abc.Iterator:
|
|
1361
1351
|
...
|
|
1362
1352
|
def __len__(self) -> int:
|
|
1363
|
-
|
|
1364
|
-
Return the number of components (always 4).
|
|
1365
|
-
|
|
1366
|
-
Returns:
|
|
1367
|
-
int: Always returns 4 (ax, ay, bx, by).
|
|
1368
|
-
"""
|
|
1353
|
+
...
|
|
1369
1354
|
def __ne__(self, other: Line) -> bool:
|
|
1370
|
-
|
|
1371
|
-
Check if two lines are not equal.
|
|
1372
|
-
|
|
1373
|
-
Args:
|
|
1374
|
-
other (Line): The other line to compare.
|
|
1375
|
-
|
|
1376
|
-
Returns:
|
|
1377
|
-
bool: True if any component differs.
|
|
1378
|
-
"""
|
|
1355
|
+
...
|
|
1379
1356
|
def copy(self) -> Line:
|
|
1380
1357
|
"""
|
|
1381
1358
|
Return a copy of this line.
|
|
@@ -1846,122 +1823,65 @@ class PixelArray:
|
|
|
1846
1823
|
class PolarCoordinate:
|
|
1847
1824
|
"""
|
|
1848
1825
|
|
|
1849
|
-
|
|
1826
|
+
PolarCoordinate models a polar coordinate pair.
|
|
1850
1827
|
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
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
|
+
|
|
1854
1835
|
"""
|
|
1855
1836
|
def __eq__(self, arg0: PolarCoordinate) -> bool:
|
|
1856
|
-
|
|
1857
|
-
Check if two PolarCoordinates are equal.
|
|
1858
|
-
|
|
1859
|
-
Args:
|
|
1860
|
-
other (PolarCoordinate): The other PolarCoordinate to compare.
|
|
1861
|
-
|
|
1862
|
-
Returns:
|
|
1863
|
-
bool: True if both angle and radius are equal.
|
|
1864
|
-
"""
|
|
1837
|
+
...
|
|
1865
1838
|
def __getitem__(self, index: typing.SupportsInt) -> float:
|
|
1866
|
-
|
|
1867
|
-
Access polar coordinate components by index.
|
|
1868
|
-
|
|
1869
|
-
Args:
|
|
1870
|
-
index (int): Index (0=angle, 1=radius).
|
|
1871
|
-
|
|
1872
|
-
Returns:
|
|
1873
|
-
float: The component value.
|
|
1874
|
-
|
|
1875
|
-
Raises:
|
|
1876
|
-
IndexError: If index is not 0 or 1.
|
|
1877
|
-
"""
|
|
1839
|
+
...
|
|
1878
1840
|
def __hash__(self) -> int:
|
|
1879
|
-
|
|
1880
|
-
Return a hash value for the PolarCoordinate.
|
|
1881
|
-
|
|
1882
|
-
Returns:
|
|
1883
|
-
int: Hash value based on angle and radius.
|
|
1884
|
-
"""
|
|
1841
|
+
...
|
|
1885
1842
|
@typing.overload
|
|
1886
1843
|
def __init__(self) -> None:
|
|
1887
1844
|
"""
|
|
1888
|
-
|
|
1845
|
+
Initialize a PolarCoordinate with zero angle and radius.
|
|
1889
1846
|
"""
|
|
1890
1847
|
@typing.overload
|
|
1891
1848
|
def __init__(self, angle: typing.SupportsFloat, radius: typing.SupportsFloat) -> None:
|
|
1892
1849
|
"""
|
|
1893
|
-
|
|
1850
|
+
Initialize a PolarCoordinate from explicit values.
|
|
1894
1851
|
|
|
1895
1852
|
Args:
|
|
1896
|
-
angle (float):
|
|
1897
|
-
radius (float):
|
|
1853
|
+
angle (float): Angle in radians.
|
|
1854
|
+
radius (float): Distance from the origin.
|
|
1898
1855
|
"""
|
|
1899
1856
|
@typing.overload
|
|
1900
1857
|
def __init__(self, arg0: collections.abc.Sequence) -> None:
|
|
1901
1858
|
"""
|
|
1902
|
-
|
|
1859
|
+
Initialize a PolarCoordinate from a two-item sequence.
|
|
1903
1860
|
|
|
1904
1861
|
Args:
|
|
1905
|
-
sequence
|
|
1862
|
+
sequence (Sequence[float]): Iterable containing [angle, radius].
|
|
1906
1863
|
|
|
1907
1864
|
Raises:
|
|
1908
|
-
RuntimeError: If sequence
|
|
1865
|
+
RuntimeError: If the sequence does not contain exactly two elements.
|
|
1909
1866
|
"""
|
|
1910
1867
|
def __iter__(self) -> collections.abc.Iterator:
|
|
1911
|
-
|
|
1912
|
-
Return an iterator over (angle, radius).
|
|
1913
|
-
|
|
1914
|
-
Returns:
|
|
1915
|
-
iterator: Iterator that yields angle first, then radius.
|
|
1916
|
-
"""
|
|
1868
|
+
...
|
|
1917
1869
|
def __len__(self) -> int:
|
|
1918
|
-
|
|
1919
|
-
Return the number of components (always 2).
|
|
1920
|
-
|
|
1921
|
-
Returns:
|
|
1922
|
-
int: Always returns 2 (angle and radius).
|
|
1923
|
-
"""
|
|
1870
|
+
...
|
|
1924
1871
|
def __ne__(self, arg0: PolarCoordinate) -> bool:
|
|
1925
|
-
|
|
1926
|
-
Check if two PolarCoordinates are not equal.
|
|
1927
|
-
|
|
1928
|
-
Args:
|
|
1929
|
-
other (PolarCoordinate): The other PolarCoordinate to compare.
|
|
1930
|
-
|
|
1931
|
-
Returns:
|
|
1932
|
-
bool: True if angle or radius are different.
|
|
1933
|
-
"""
|
|
1872
|
+
...
|
|
1934
1873
|
def __repr__(self) -> str:
|
|
1935
|
-
|
|
1936
|
-
Return a string suitable for debugging and recreation.
|
|
1937
|
-
|
|
1938
|
-
Returns:
|
|
1939
|
-
str: String in format "PolarCoordinate(angle, radius)".
|
|
1940
|
-
"""
|
|
1874
|
+
...
|
|
1941
1875
|
def __setitem__(self, index: typing.SupportsInt, value: typing.SupportsFloat) -> None:
|
|
1942
|
-
|
|
1943
|
-
Set polar coordinate components by index.
|
|
1944
|
-
|
|
1945
|
-
Args:
|
|
1946
|
-
index (int): Index (0=angle, 1=radius).
|
|
1947
|
-
value (float): The new value to set.
|
|
1948
|
-
|
|
1949
|
-
Raises:
|
|
1950
|
-
IndexError: If index is not 0 or 1.
|
|
1951
|
-
"""
|
|
1876
|
+
...
|
|
1952
1877
|
def __str__(self) -> str:
|
|
1953
|
-
|
|
1954
|
-
Return a human-readable string representation.
|
|
1955
|
-
|
|
1956
|
-
Returns:
|
|
1957
|
-
str: String in format "(angle, radius)".
|
|
1958
|
-
"""
|
|
1878
|
+
...
|
|
1959
1879
|
def to_cartesian(self) -> Vec2:
|
|
1960
1880
|
"""
|
|
1961
|
-
Convert
|
|
1881
|
+
Convert this PolarCoordinate to a Vec2.
|
|
1962
1882
|
|
|
1963
1883
|
Returns:
|
|
1964
|
-
Vec2:
|
|
1884
|
+
Vec2: Cartesian representation of this coordinate.
|
|
1965
1885
|
"""
|
|
1966
1886
|
@property
|
|
1967
1887
|
def angle(self) -> float:
|
|
@@ -1989,48 +1909,95 @@ class Polygon:
|
|
|
1989
1909
|
|
|
1990
1910
|
"""
|
|
1991
1911
|
def __getitem__(self, index: typing.SupportsInt) -> Vec2:
|
|
1912
|
+
...
|
|
1913
|
+
@typing.overload
|
|
1914
|
+
def __init__(self) -> None:
|
|
1992
1915
|
"""
|
|
1993
|
-
|
|
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.
|
|
1994
1922
|
|
|
1995
1923
|
Args:
|
|
1996
|
-
|
|
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.
|
|
1997
1933
|
|
|
1998
1934
|
Returns:
|
|
1999
|
-
|
|
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.
|
|
2000
1940
|
|
|
2001
|
-
|
|
2002
|
-
|
|
1941
|
+
Args:
|
|
1942
|
+
angle (float): The rotation angle in radians.
|
|
1943
|
+
pivot (Vec2): The point to rotate around.
|
|
2003
1944
|
"""
|
|
2004
1945
|
@typing.overload
|
|
2005
|
-
def
|
|
1946
|
+
def scale(self, factor: typing.SupportsFloat, pivot: Vec2) -> None:
|
|
2006
1947
|
"""
|
|
2007
|
-
|
|
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.
|
|
2008
1953
|
"""
|
|
2009
1954
|
@typing.overload
|
|
2010
|
-
def
|
|
1955
|
+
def scale(self, factor: Vec2, pivot: Vec2) -> None:
|
|
2011
1956
|
"""
|
|
2012
|
-
|
|
1957
|
+
Scale the polygon non-uniformly from a pivot point.
|
|
2013
1958
|
|
|
2014
1959
|
Args:
|
|
2015
|
-
|
|
1960
|
+
factor (Vec2): The scaling factors for x and y.
|
|
1961
|
+
pivot (Vec2): The point to scale from.
|
|
2016
1962
|
"""
|
|
2017
|
-
def
|
|
1963
|
+
def translate(self, offset: Vec2) -> None:
|
|
2018
1964
|
"""
|
|
2019
|
-
|
|
1965
|
+
Move the polygon by an offset.
|
|
1966
|
+
|
|
1967
|
+
Args:
|
|
1968
|
+
offset (Vec2): The offset to move by.
|
|
2020
1969
|
"""
|
|
2021
|
-
|
|
1970
|
+
@property
|
|
1971
|
+
def area(self) -> float:
|
|
2022
1972
|
"""
|
|
2023
|
-
|
|
1973
|
+
Get the area of the polygon.
|
|
2024
1974
|
|
|
2025
1975
|
Returns:
|
|
2026
|
-
|
|
1976
|
+
float: The area enclosed by the polygon.
|
|
2027
1977
|
"""
|
|
2028
|
-
|
|
1978
|
+
@property
|
|
1979
|
+
def bounds(self) -> Rect:
|
|
2029
1980
|
"""
|
|
2030
|
-
|
|
1981
|
+
Get the bounding rectangle of the polygon.
|
|
2031
1982
|
|
|
2032
1983
|
Returns:
|
|
2033
|
-
|
|
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.
|
|
2034
2001
|
"""
|
|
2035
2002
|
@property
|
|
2036
2003
|
def points(self) -> list[Vec2]:
|
|
@@ -2047,39 +2014,15 @@ class Rect:
|
|
|
2047
2014
|
|
|
2048
2015
|
A Rect is defined by its top-left corner position (x, y) and dimensions (w, h).
|
|
2049
2016
|
Supports various geometric operations, collision detection, and positioning methods.
|
|
2050
|
-
|
|
2017
|
+
|
|
2051
2018
|
"""
|
|
2052
2019
|
__hash__: typing.ClassVar[None] = None
|
|
2053
2020
|
def __bool__(self) -> bool:
|
|
2054
|
-
|
|
2055
|
-
Check if the rectangle has positive area.
|
|
2056
|
-
|
|
2057
|
-
Returns:
|
|
2058
|
-
bool: True if both width and height are greater than 0.
|
|
2059
|
-
"""
|
|
2021
|
+
...
|
|
2060
2022
|
def __eq__(self, other: Rect) -> bool:
|
|
2061
|
-
|
|
2062
|
-
Check if two rectangles are equal.
|
|
2063
|
-
|
|
2064
|
-
Args:
|
|
2065
|
-
other (Rect): The other rectangle to compare.
|
|
2066
|
-
|
|
2067
|
-
Returns:
|
|
2068
|
-
bool: True if all components (x, y, w, h) are equal.
|
|
2069
|
-
"""
|
|
2023
|
+
...
|
|
2070
2024
|
def __getitem__(self, index: typing.SupportsInt) -> float:
|
|
2071
|
-
|
|
2072
|
-
Access rectangle components by index.
|
|
2073
|
-
|
|
2074
|
-
Args:
|
|
2075
|
-
index (int): Index (0=x, 1=y, 2=w, 3=h).
|
|
2076
|
-
|
|
2077
|
-
Returns:
|
|
2078
|
-
float: The component value.
|
|
2079
|
-
|
|
2080
|
-
Raises:
|
|
2081
|
-
IndexError: If index is not 0, 1, 2, or 3.
|
|
2082
|
-
"""
|
|
2025
|
+
...
|
|
2083
2026
|
@typing.overload
|
|
2084
2027
|
def __init__(self) -> None:
|
|
2085
2028
|
"""
|
|
@@ -2137,43 +2080,15 @@ class Rect:
|
|
|
2137
2080
|
RuntimeError: If sequence doesn't contain exactly 4 elements.
|
|
2138
2081
|
"""
|
|
2139
2082
|
def __iter__(self) -> collections.abc.Iterator:
|
|
2140
|
-
|
|
2141
|
-
Return an iterator over (x, y, w, h).
|
|
2142
|
-
|
|
2143
|
-
Returns:
|
|
2144
|
-
iterator: Iterator that yields x, y, w, h in order.
|
|
2145
|
-
"""
|
|
2083
|
+
...
|
|
2146
2084
|
def __len__(self) -> int:
|
|
2147
|
-
|
|
2148
|
-
Return the number of components (always 4).
|
|
2149
|
-
|
|
2150
|
-
Returns:
|
|
2151
|
-
int: Always returns 4 (x, y, w, h).
|
|
2152
|
-
"""
|
|
2085
|
+
...
|
|
2153
2086
|
def __ne__(self, other: Rect) -> bool:
|
|
2154
|
-
|
|
2155
|
-
Check if two rectangles are not equal.
|
|
2156
|
-
|
|
2157
|
-
Args:
|
|
2158
|
-
other (Rect): The other rectangle to compare.
|
|
2159
|
-
|
|
2160
|
-
Returns:
|
|
2161
|
-
bool: True if any component differs.
|
|
2162
|
-
"""
|
|
2087
|
+
...
|
|
2163
2088
|
def __repr__(self) -> str:
|
|
2164
|
-
|
|
2165
|
-
Return a string suitable for debugging and recreation.
|
|
2166
|
-
|
|
2167
|
-
Returns:
|
|
2168
|
-
str: String in format "Rect(x=..., y=..., w=..., h=...)".
|
|
2169
|
-
"""
|
|
2089
|
+
...
|
|
2170
2090
|
def __str__(self) -> str:
|
|
2171
|
-
|
|
2172
|
-
Return a human-readable string representation.
|
|
2173
|
-
|
|
2174
|
-
Returns:
|
|
2175
|
-
str: String in format "[x, y, w, h]".
|
|
2176
|
-
"""
|
|
2091
|
+
...
|
|
2177
2092
|
@typing.overload
|
|
2178
2093
|
def clamp(self, other: Rect) -> None:
|
|
2179
2094
|
"""
|
|
@@ -2561,24 +2476,182 @@ class ShaderState:
|
|
|
2561
2476
|
"""
|
|
2562
2477
|
Encapsulates a GPU shader and its associated render state.
|
|
2563
2478
|
"""
|
|
2564
|
-
def __init__(self, fragment_file_path: str,
|
|
2565
|
-
|
|
2479
|
+
def __init__(self, fragment_file_path: str, uniform_buffer_count: typing.SupportsInt = 0) -> None:
|
|
2480
|
+
"""
|
|
2481
|
+
Create a ShaderState from the specified fragment shader file.
|
|
2482
|
+
|
|
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
|
+
"""
|
|
2566
2487
|
def bind(self) -> None:
|
|
2567
2488
|
"""
|
|
2568
2489
|
Binds this shader state to the current render pass, making it active for subsequent draw calls.
|
|
2569
2490
|
"""
|
|
2570
2491
|
def set_uniform(self, binding: typing.SupportsInt, data: collections.abc.Buffer) -> None:
|
|
2571
2492
|
"""
|
|
2572
|
-
|
|
2493
|
+
Set uniform data for the fragment shader at the specified binding point.
|
|
2573
2494
|
|
|
2574
|
-
|
|
2575
|
-
binding (int):
|
|
2576
|
-
data (buffer):
|
|
2495
|
+
Args:
|
|
2496
|
+
binding (int): Uniform buffer binding index.
|
|
2497
|
+
data (buffer): Buffer or bytes object containing the uniform data to upload.
|
|
2577
2498
|
"""
|
|
2578
2499
|
def unbind(self) -> None:
|
|
2579
2500
|
"""
|
|
2580
2501
|
Unbinds the current shader state, reverting to the default render state.
|
|
2581
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
|
+
...
|
|
2582
2655
|
class Texture:
|
|
2583
2656
|
"""
|
|
2584
2657
|
|
|
@@ -2716,9 +2789,6 @@ class Tile:
|
|
|
2716
2789
|
"""
|
|
2717
2790
|
|
|
2718
2791
|
Represents a single tile instance in a layer.
|
|
2719
|
-
|
|
2720
|
-
Contains source and destination rectangles, a collider, flip flags, rotation angle,
|
|
2721
|
-
and a reference to its owning Layer.
|
|
2722
2792
|
|
|
2723
2793
|
"""
|
|
2724
2794
|
@property
|
|
@@ -2973,340 +3043,226 @@ class Timer:
|
|
|
2973
3043
|
class Vec2:
|
|
2974
3044
|
"""
|
|
2975
3045
|
|
|
2976
|
-
|
|
3046
|
+
Vec2 represents a 2D vector.
|
|
2977
3047
|
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
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
|
+
|
|
2981
3065
|
"""
|
|
2982
3066
|
def __add__(self, other: Vec2) -> Vec2:
|
|
2983
|
-
|
|
2984
|
-
Add another Vec2 to this Vec2.
|
|
2985
|
-
|
|
2986
|
-
Args:
|
|
2987
|
-
other (Vec2): The Vec2 to add.
|
|
2988
|
-
|
|
2989
|
-
Returns:
|
|
2990
|
-
Vec2: A new Vec2 with the result of the addition.
|
|
2991
|
-
"""
|
|
3067
|
+
...
|
|
2992
3068
|
def __bool__(self) -> bool:
|
|
2993
|
-
|
|
2994
|
-
Check if the vector is not zero.
|
|
2995
|
-
|
|
2996
|
-
Returns:
|
|
2997
|
-
bool: True if the vector is not zero, False if it is zero.
|
|
2998
|
-
"""
|
|
3069
|
+
...
|
|
2999
3070
|
def __eq__(self, other: Vec2) -> bool:
|
|
3000
|
-
|
|
3001
|
-
Check if two Vec2s are equal (within tolerance).
|
|
3002
|
-
|
|
3003
|
-
Args:
|
|
3004
|
-
other (Vec2): The other Vec2 to compare.
|
|
3005
|
-
|
|
3006
|
-
Returns:
|
|
3007
|
-
bool: True if vectors are equal within tolerance.
|
|
3008
|
-
"""
|
|
3071
|
+
...
|
|
3009
3072
|
def __ge__(self, other: Vec2) -> bool:
|
|
3010
|
-
|
|
3011
|
-
Check if this Vec2 is component-wise greater than or equal to another.
|
|
3012
|
-
|
|
3013
|
-
Args:
|
|
3014
|
-
other (Vec2): The other Vec2 to compare.
|
|
3015
|
-
|
|
3016
|
-
Returns:
|
|
3017
|
-
bool: True if not component-wise less than other.
|
|
3018
|
-
"""
|
|
3073
|
+
...
|
|
3019
3074
|
def __getitem__(self, index: typing.SupportsInt) -> float:
|
|
3020
|
-
|
|
3021
|
-
Access vector components by index.
|
|
3022
|
-
|
|
3023
|
-
Args:
|
|
3024
|
-
index (int): Index (0=x, 1=y).
|
|
3025
|
-
|
|
3026
|
-
Returns:
|
|
3027
|
-
float: The component value.
|
|
3028
|
-
|
|
3029
|
-
Raises:
|
|
3030
|
-
IndexError: If index is not 0 or 1.
|
|
3031
|
-
"""
|
|
3075
|
+
...
|
|
3032
3076
|
def __gt__(self, other: Vec2) -> bool:
|
|
3033
|
-
|
|
3034
|
-
Check if this Vec2 is component-wise greater than another.
|
|
3035
|
-
|
|
3036
|
-
Args:
|
|
3037
|
-
other (Vec2): The other Vec2 to compare.
|
|
3038
|
-
|
|
3039
|
-
Returns:
|
|
3040
|
-
bool: True if both x and y are greater than other's x and y.
|
|
3041
|
-
"""
|
|
3077
|
+
...
|
|
3042
3078
|
def __hash__(self) -> int:
|
|
3043
|
-
|
|
3044
|
-
Return a hash value for the Vec2.
|
|
3045
|
-
|
|
3046
|
-
Returns:
|
|
3047
|
-
int: Hash value based on x and y components.
|
|
3048
|
-
"""
|
|
3079
|
+
...
|
|
3049
3080
|
def __iadd__(self, other: Vec2) -> Vec2:
|
|
3050
|
-
|
|
3051
|
-
In-place addition (self += other).
|
|
3052
|
-
|
|
3053
|
-
Args:
|
|
3054
|
-
other (Vec2): The Vec2 to add.
|
|
3055
|
-
|
|
3056
|
-
Returns:
|
|
3057
|
-
Vec2: Reference to self after modification.
|
|
3058
|
-
"""
|
|
3081
|
+
...
|
|
3059
3082
|
def __imul__(self, scalar: typing.SupportsFloat) -> Vec2:
|
|
3060
|
-
|
|
3061
|
-
In-place multiplication by a scalar value (self *= scalar).
|
|
3062
|
-
|
|
3063
|
-
Args:
|
|
3064
|
-
scalar (float): The scalar to multiply by.
|
|
3065
|
-
|
|
3066
|
-
Returns:
|
|
3067
|
-
Vec2: Reference to self after modification.
|
|
3068
|
-
"""
|
|
3083
|
+
...
|
|
3069
3084
|
@typing.overload
|
|
3070
3085
|
def __init__(self) -> None:
|
|
3071
3086
|
"""
|
|
3072
|
-
|
|
3087
|
+
Initialize a Vec2 with zeroed components.
|
|
3073
3088
|
"""
|
|
3074
3089
|
@typing.overload
|
|
3075
3090
|
def __init__(self, value: typing.SupportsFloat) -> None:
|
|
3076
3091
|
"""
|
|
3077
|
-
|
|
3092
|
+
Initialize a Vec2 with identical x and y values.
|
|
3078
3093
|
|
|
3079
3094
|
Args:
|
|
3080
|
-
value (float): Value to
|
|
3095
|
+
value (float): Value assigned to both components.
|
|
3081
3096
|
"""
|
|
3082
3097
|
@typing.overload
|
|
3083
3098
|
def __init__(self, x: typing.SupportsFloat, y: typing.SupportsFloat) -> None:
|
|
3084
3099
|
"""
|
|
3085
|
-
|
|
3100
|
+
Initialize a Vec2 with explicit component values.
|
|
3086
3101
|
|
|
3087
3102
|
Args:
|
|
3088
|
-
x (float):
|
|
3089
|
-
y (float):
|
|
3103
|
+
x (float): Horizontal component.
|
|
3104
|
+
y (float): Vertical component.
|
|
3090
3105
|
"""
|
|
3091
3106
|
@typing.overload
|
|
3092
3107
|
def __init__(self, arg0: collections.abc.Sequence) -> None:
|
|
3093
3108
|
"""
|
|
3094
|
-
|
|
3109
|
+
Initialize a Vec2 from a two-item sequence.
|
|
3095
3110
|
|
|
3096
3111
|
Args:
|
|
3097
|
-
sequence
|
|
3112
|
+
sequence (Sequence[float]): Iterable containing [x, y].
|
|
3098
3113
|
|
|
3099
3114
|
Raises:
|
|
3100
|
-
RuntimeError: If sequence
|
|
3115
|
+
RuntimeError: If the sequence does not contain exactly two elements.
|
|
3101
3116
|
"""
|
|
3102
3117
|
def __isub__(self, other: Vec2) -> Vec2:
|
|
3103
|
-
|
|
3104
|
-
In-place subtraction (self -= other).
|
|
3105
|
-
|
|
3106
|
-
Args:
|
|
3107
|
-
other (Vec2): The Vec2 to subtract.
|
|
3108
|
-
|
|
3109
|
-
Returns:
|
|
3110
|
-
Vec2: Reference to self after modification.
|
|
3111
|
-
"""
|
|
3118
|
+
...
|
|
3112
3119
|
def __iter__(self) -> collections.abc.Iterator:
|
|
3113
|
-
|
|
3114
|
-
Return an iterator over (x, y).
|
|
3115
|
-
|
|
3116
|
-
Returns:
|
|
3117
|
-
iterator: Iterator that yields x first, then y.
|
|
3118
|
-
"""
|
|
3120
|
+
...
|
|
3119
3121
|
def __itruediv__(self, scalar: typing.SupportsFloat) -> Vec2:
|
|
3120
|
-
|
|
3121
|
-
In-place division by a scalar value (self /= scalar).
|
|
3122
|
-
|
|
3123
|
-
Args:
|
|
3124
|
-
scalar (float): The scalar to divide by.
|
|
3125
|
-
|
|
3126
|
-
Returns:
|
|
3127
|
-
Vec2: Reference to self after modification.
|
|
3128
|
-
"""
|
|
3122
|
+
...
|
|
3129
3123
|
def __le__(self, other: Vec2) -> bool:
|
|
3130
|
-
|
|
3131
|
-
Check if this Vec2 is component-wise less than or equal to another.
|
|
3132
|
-
|
|
3133
|
-
Args:
|
|
3134
|
-
other (Vec2): The other Vec2 to compare.
|
|
3135
|
-
|
|
3136
|
-
Returns:
|
|
3137
|
-
bool: True if not component-wise greater than other.
|
|
3138
|
-
"""
|
|
3124
|
+
...
|
|
3139
3125
|
def __len__(self) -> int:
|
|
3140
|
-
|
|
3141
|
-
Return the number of components (always 2).
|
|
3142
|
-
|
|
3143
|
-
Returns:
|
|
3144
|
-
int: Always returns 2 (x and y).
|
|
3145
|
-
"""
|
|
3126
|
+
...
|
|
3146
3127
|
def __lt__(self, other: Vec2) -> bool:
|
|
3147
|
-
|
|
3148
|
-
Check if this Vec2 is component-wise less than another.
|
|
3149
|
-
|
|
3150
|
-
Args:
|
|
3151
|
-
other (Vec2): The other Vec2 to compare.
|
|
3152
|
-
|
|
3153
|
-
Returns:
|
|
3154
|
-
bool: True if both x and y are less than other's x and y.
|
|
3155
|
-
"""
|
|
3128
|
+
...
|
|
3156
3129
|
def __mul__(self, scalar: typing.SupportsFloat) -> Vec2:
|
|
3157
|
-
|
|
3158
|
-
Multiply the vector by a scalar value.
|
|
3159
|
-
|
|
3160
|
-
Args:
|
|
3161
|
-
scalar (float): The scalar to multiply by.
|
|
3162
|
-
|
|
3163
|
-
Returns:
|
|
3164
|
-
Vec2: A new Vec2 with multiplied components.
|
|
3165
|
-
"""
|
|
3130
|
+
...
|
|
3166
3131
|
def __ne__(self, other: Vec2) -> bool:
|
|
3167
|
-
|
|
3168
|
-
Check if two Vec2s are not equal.
|
|
3169
|
-
|
|
3170
|
-
Args:
|
|
3171
|
-
other (Vec2): The other Vec2 to compare.
|
|
3172
|
-
|
|
3173
|
-
Returns:
|
|
3174
|
-
bool: True if vectors are not equal.
|
|
3175
|
-
"""
|
|
3132
|
+
...
|
|
3176
3133
|
def __neg__(self) -> Vec2:
|
|
3177
|
-
|
|
3178
|
-
Return the negation of this vector (-self).
|
|
3179
|
-
|
|
3180
|
-
Returns:
|
|
3181
|
-
Vec2: A new Vec2 with negated x and y components.
|
|
3182
|
-
"""
|
|
3134
|
+
...
|
|
3183
3135
|
def __radd__(self, other: Vec2) -> Vec2:
|
|
3184
|
-
|
|
3185
|
-
Right-hand addition (other + self).
|
|
3186
|
-
|
|
3187
|
-
Args:
|
|
3188
|
-
other (Vec2): The Vec2 to add.
|
|
3189
|
-
|
|
3190
|
-
Returns:
|
|
3191
|
-
Vec2: A new Vec2 with the result of the addition.
|
|
3192
|
-
"""
|
|
3136
|
+
...
|
|
3193
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:
|
|
3194
3152
|
"""
|
|
3195
|
-
Return a
|
|
3153
|
+
Return a copy of this Vec2.
|
|
3196
3154
|
|
|
3197
3155
|
Returns:
|
|
3198
|
-
|
|
3156
|
+
Vec2: A duplicated vector with the same components.
|
|
3199
3157
|
"""
|
|
3200
|
-
def
|
|
3158
|
+
def distance_squared_to(self, other: Vec2) -> float:
|
|
3201
3159
|
"""
|
|
3202
|
-
|
|
3160
|
+
Compute the squared distance to another Vec2.
|
|
3203
3161
|
|
|
3204
3162
|
Args:
|
|
3205
|
-
|
|
3163
|
+
other (Vec2): Comparison vector.
|
|
3206
3164
|
|
|
3207
3165
|
Returns:
|
|
3208
|
-
|
|
3166
|
+
float: Squared distance between the vectors.
|
|
3209
3167
|
"""
|
|
3210
|
-
def
|
|
3168
|
+
def distance_to(self, other: Vec2) -> float:
|
|
3211
3169
|
"""
|
|
3212
|
-
|
|
3170
|
+
Compute the Euclidean distance to another Vec2.
|
|
3213
3171
|
|
|
3214
3172
|
Args:
|
|
3215
|
-
other (Vec2):
|
|
3173
|
+
other (Vec2): Comparison vector.
|
|
3216
3174
|
|
|
3217
3175
|
Returns:
|
|
3218
|
-
|
|
3176
|
+
float: Distance between the vectors.
|
|
3219
3177
|
"""
|
|
3220
|
-
def
|
|
3178
|
+
def is_zero(self, tolerance: typing.SupportsFloat = 1e-08) -> bool:
|
|
3221
3179
|
"""
|
|
3222
|
-
|
|
3180
|
+
Determine whether this Vec2 is effectively zero.
|
|
3223
3181
|
|
|
3224
3182
|
Args:
|
|
3225
|
-
|
|
3226
|
-
value (float): The new value to set.
|
|
3183
|
+
tolerance (float): Largest allowed absolute component magnitude.
|
|
3227
3184
|
|
|
3228
|
-
|
|
3229
|
-
|
|
3185
|
+
Returns:
|
|
3186
|
+
bool: True if both components are within the tolerance.
|
|
3230
3187
|
"""
|
|
3231
|
-
def
|
|
3188
|
+
def normalize(self) -> None:
|
|
3232
3189
|
"""
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
Returns:
|
|
3236
|
-
str: String in format "<x, y>".
|
|
3190
|
+
Normalize this Vec2 in place.
|
|
3237
3191
|
"""
|
|
3238
|
-
def
|
|
3192
|
+
def project(self, other: Vec2) -> Vec2:
|
|
3239
3193
|
"""
|
|
3240
|
-
|
|
3194
|
+
Project this Vec2 onto another Vec2.
|
|
3241
3195
|
|
|
3242
3196
|
Args:
|
|
3243
|
-
other (Vec2): The
|
|
3197
|
+
other (Vec2): The vector to project onto.
|
|
3244
3198
|
|
|
3245
3199
|
Returns:
|
|
3246
|
-
Vec2:
|
|
3200
|
+
Vec2: Projection of this vector onto the other vector.
|
|
3247
3201
|
"""
|
|
3248
|
-
def
|
|
3202
|
+
def reflect(self, other: Vec2) -> Vec2:
|
|
3249
3203
|
"""
|
|
3250
|
-
|
|
3204
|
+
Reflect this Vec2 across another Vec2.
|
|
3251
3205
|
|
|
3252
3206
|
Args:
|
|
3253
|
-
|
|
3207
|
+
other (Vec2): The vector used as the reflection normal.
|
|
3254
3208
|
|
|
3255
3209
|
Returns:
|
|
3256
|
-
Vec2:
|
|
3210
|
+
Vec2: Reflected vector.
|
|
3257
3211
|
"""
|
|
3258
|
-
def
|
|
3212
|
+
def reject(self, other: Vec2) -> Vec2:
|
|
3259
3213
|
"""
|
|
3260
|
-
|
|
3214
|
+
Compute the rejection of this Vec2 from another Vec2.
|
|
3261
3215
|
|
|
3262
3216
|
Args:
|
|
3263
|
-
other (Vec2): The
|
|
3217
|
+
other (Vec2): The vector defining the projection axis.
|
|
3264
3218
|
|
|
3265
3219
|
Returns:
|
|
3266
|
-
|
|
3267
|
-
"""
|
|
3268
|
-
def normalize(self) -> None:
|
|
3269
|
-
"""
|
|
3270
|
-
Normalize the vector to unit length in-place.
|
|
3271
|
-
|
|
3272
|
-
If the vector is zero, it remains unchanged.
|
|
3220
|
+
Vec2: Component of this vector orthogonal to the other vector.
|
|
3273
3221
|
"""
|
|
3274
3222
|
def rotate(self, radians: typing.SupportsFloat) -> None:
|
|
3275
3223
|
"""
|
|
3276
|
-
Rotate
|
|
3224
|
+
Rotate this Vec2 in place.
|
|
3277
3225
|
|
|
3278
3226
|
Args:
|
|
3279
|
-
radians (float):
|
|
3227
|
+
radians (float): Rotation angle in radians.
|
|
3280
3228
|
"""
|
|
3281
3229
|
def scale_to_length(self, length: typing.SupportsFloat) -> None:
|
|
3282
3230
|
"""
|
|
3283
|
-
Scale
|
|
3231
|
+
Scale this Vec2 to a specific magnitude.
|
|
3284
3232
|
|
|
3285
3233
|
Args:
|
|
3286
|
-
length (float):
|
|
3234
|
+
length (float): Target vector length.
|
|
3287
3235
|
"""
|
|
3288
3236
|
def to_polar(self) -> PolarCoordinate:
|
|
3289
3237
|
"""
|
|
3290
|
-
Convert to polar coordinates.
|
|
3238
|
+
Convert this Vec2 to polar coordinates.
|
|
3291
3239
|
|
|
3292
3240
|
Returns:
|
|
3293
|
-
PolarCoordinate:
|
|
3241
|
+
PolarCoordinate: Polar representation with angle and length.
|
|
3294
3242
|
"""
|
|
3295
3243
|
@property
|
|
3296
3244
|
def angle(self) -> float:
|
|
3297
3245
|
"""
|
|
3298
|
-
|
|
3246
|
+
Return the vector angle in radians.
|
|
3299
3247
|
|
|
3300
3248
|
Returns:
|
|
3301
|
-
float:
|
|
3249
|
+
float: Angle measured from the positive x-axis.
|
|
3302
3250
|
"""
|
|
3303
3251
|
@property
|
|
3304
3252
|
def length(self) -> float:
|
|
3305
3253
|
"""
|
|
3306
|
-
|
|
3254
|
+
Return the magnitude of this Vec2.
|
|
3307
3255
|
|
|
3308
3256
|
Returns:
|
|
3309
|
-
float:
|
|
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.
|
|
3310
3266
|
"""
|
|
3311
3267
|
@property
|
|
3312
3268
|
def x(self) -> float:
|
|
@@ -3319,12 +3275,18 @@ class Vec2:
|
|
|
3319
3275
|
@property
|
|
3320
3276
|
def xx(self) -> Vec2:
|
|
3321
3277
|
"""
|
|
3322
|
-
|
|
3278
|
+
Return a Vec2 with both components set to x.
|
|
3279
|
+
|
|
3280
|
+
Returns:
|
|
3281
|
+
Vec2: Vector composed of (x, x).
|
|
3323
3282
|
"""
|
|
3324
3283
|
@property
|
|
3325
3284
|
def xy(self) -> Vec2:
|
|
3326
3285
|
"""
|
|
3327
|
-
|
|
3286
|
+
Access or assign the (x, y) components as a Vec2.
|
|
3287
|
+
|
|
3288
|
+
Returns:
|
|
3289
|
+
Vec2: Current (x, y) components.
|
|
3328
3290
|
"""
|
|
3329
3291
|
@xy.setter
|
|
3330
3292
|
def xy(self, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None:
|
|
@@ -3340,7 +3302,10 @@ class Vec2:
|
|
|
3340
3302
|
@property
|
|
3341
3303
|
def yx(self) -> Vec2:
|
|
3342
3304
|
"""
|
|
3343
|
-
|
|
3305
|
+
Access or assign the (y, x) components as a Vec2.
|
|
3306
|
+
|
|
3307
|
+
Returns:
|
|
3308
|
+
Vec2: Current (y, x) components.
|
|
3344
3309
|
"""
|
|
3345
3310
|
@yx.setter
|
|
3346
3311
|
def yx(self, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None:
|
|
@@ -3348,31 +3313,39 @@ class Vec2:
|
|
|
3348
3313
|
@property
|
|
3349
3314
|
def yy(self) -> Vec2:
|
|
3350
3315
|
"""
|
|
3351
|
-
|
|
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.
|
|
3352
3330
|
"""
|
|
3353
3331
|
def init() -> None:
|
|
3354
3332
|
"""
|
|
3355
|
-
Initialize the Kraken
|
|
3333
|
+
Initialize the Kraken engine subsystems.
|
|
3356
3334
|
|
|
3357
|
-
|
|
3335
|
+
Raises:
|
|
3336
|
+
RuntimeError: If SDL initialization fails.
|
|
3358
3337
|
"""
|
|
3359
3338
|
def quit() -> None:
|
|
3360
3339
|
"""
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
Call this once you're done using the engine to avoid memory leaks.
|
|
3340
|
+
Tear down the Kraken engine subsystems.
|
|
3364
3341
|
"""
|
|
3365
3342
|
AUDIO_DEVICE_ADDED: EventType # value = <EventType.AUDIO_DEVICE_ADDED: 4352>
|
|
3366
3343
|
AUDIO_DEVICE_FORMAT_CHANGED: EventType # value = <EventType.AUDIO_DEVICE_FORMAT_CHANGED: 4354>
|
|
3367
3344
|
AUDIO_DEVICE_REMOVED: EventType # value = <EventType.AUDIO_DEVICE_REMOVED: 4353>
|
|
3368
|
-
BOTTOM_LEFT: Anchor # value = <Anchor.BOTTOM_LEFT: 6>
|
|
3369
|
-
BOTTOM_MID: Anchor # value = <Anchor.BOTTOM_MID: 7>
|
|
3370
|
-
BOTTOM_RIGHT: Anchor # value = <Anchor.BOTTOM_RIGHT: 8>
|
|
3371
3345
|
CAMERA_DEVICE_ADDED: EventType # value = <EventType.CAMERA_DEVICE_ADDED: 5120>
|
|
3372
3346
|
CAMERA_DEVICE_APPROVED: EventType # value = <EventType.CAMERA_DEVICE_APPROVED: 5122>
|
|
3373
3347
|
CAMERA_DEVICE_DENIED: EventType # value = <EventType.CAMERA_DEVICE_DENIED: 5123>
|
|
3374
3348
|
CAMERA_DEVICE_REMOVED: EventType # value = <EventType.CAMERA_DEVICE_REMOVED: 5121>
|
|
3375
|
-
CENTER: Anchor # value = <Anchor.CENTER: 4>
|
|
3376
3349
|
CLIPBOARD_UPDATE: EventType # value = <EventType.CLIPBOARD_UPDATE: 2304>
|
|
3377
3350
|
C_BACK: GamepadButton # value = <GamepadButton.C_BACK: 4>
|
|
3378
3351
|
C_DPAD_DOWN: GamepadButton # value = <GamepadButton.C_DPAD_DOWN: 12>
|
|
@@ -3606,8 +3579,6 @@ K_y: Keycode # value = <Keycode.K_y: 121>
|
|
|
3606
3579
|
K_z: Keycode # value = <Keycode.K_z: 122>
|
|
3607
3580
|
LOCALE_CHANGED: EventType # value = <EventType.LOCALE_CHANGED: 263>
|
|
3608
3581
|
LOW_MEMORY: EventType # value = <EventType.LOW_MEMORY: 258>
|
|
3609
|
-
MID_LEFT: Anchor # value = <Anchor.MID_LEFT: 3>
|
|
3610
|
-
MID_RIGHT: Anchor # value = <Anchor.MID_RIGHT: 5>
|
|
3611
3582
|
MOUSE_ADDED: EventType # value = <EventType.MOUSE_ADDED: 1028>
|
|
3612
3583
|
MOUSE_BUTTON_DOWN: EventType # value = <EventType.MOUSE_BUTTON_DOWN: 1025>
|
|
3613
3584
|
MOUSE_BUTTON_UP: EventType # value = <EventType.MOUSE_BUTTON_UP: 1026>
|
|
@@ -3786,9 +3757,6 @@ TERMINATING: EventType # value = <EventType.TERMINATING: 257>
|
|
|
3786
3757
|
TEXT_EDITING: EventType # value = <EventType.TEXT_EDITING: 770>
|
|
3787
3758
|
TEXT_EDITING_CANDIDATES: EventType # value = <EventType.TEXT_EDITING_CANDIDATES: 775>
|
|
3788
3759
|
TEXT_INPUT: EventType # value = <EventType.TEXT_INPUT: 771>
|
|
3789
|
-
TOP_LEFT: Anchor # value = <Anchor.TOP_LEFT: 0>
|
|
3790
|
-
TOP_MID: Anchor # value = <Anchor.TOP_MID: 1>
|
|
3791
|
-
TOP_RIGHT: Anchor # value = <Anchor.TOP_RIGHT: 2>
|
|
3792
3760
|
WILL_ENTER_BACKGROUND: EventType # value = <EventType.WILL_ENTER_BACKGROUND: 259>
|
|
3793
3761
|
WILL_ENTER_FOREGROUND: EventType # value = <EventType.WILL_ENTER_FOREGROUND: 261>
|
|
3794
3762
|
WINDOW_CLOSE_REQUESTED: EventType # value = <EventType.WINDOW_CLOSE_REQUESTED: 528>
|