Erste Version

This commit is contained in:
wittmannzl103469 committed 2026-11-04 21:01:26 +01:00
commit 782b1850a3
1641 files changed
+512713

No files matched your search

@@ -0,0 +1,4 @@
if __import__("sys").platform not in ("wasi", "emscripten"):
from .audio import * # pylint: disable=wildcard-import; lgtm[py/polluting-import]
from .sdl2 import * # pylint: disable=wildcard-import; lgtm[py/polluting-import]
from .video import * # pylint: disable=wildcard-import; lgtm[py/polluting-import]
@@ -0,0 +1,3 @@
from pygame._sdl2.audio import *
from pygame._sdl2.sdl2 import *
from pygame._sdl2.video import *
@@ -0,0 +1,55 @@
from collections.abc import Callable
from typing import Optional
AUDIO_U8: int
AUDIO_S8: int
AUDIO_U16LSB: int
AUDIO_S16LSB: int
AUDIO_U16MSB: int
AUDIO_S16MSB: int
AUDIO_U16: int
AUDIO_S16: int
AUDIO_S32LSB: int
AUDIO_S32MSB: int
AUDIO_S32: int
AUDIO_F32LSB: int
AUDIO_F32MSB: int
AUDIO_F32: int
AUDIO_ALLOW_FREQUENCY_CHANGE: int
AUDIO_ALLOW_FORMAT_CHANGE: int
AUDIO_ALLOW_CHANNELS_CHANGE: int
AUDIO_ALLOW_ANY_CHANGE: int
def get_audio_device_names(iscapture: bool = False) -> list[str]: ...
class AudioDevice:
def __init__(
self,
devicename: Optional[str],
iscapture: bool,
frequency: int,
audioformat: int,
numchannels: int,
chunksize: int,
allowed_changes: int,
callback: Callable[[AudioDevice, memoryview], None],
) -> None: ...
@property
def iscapture(self) -> bool: ...
@property
def deviceid(self) -> int: ...
@property
def devicename(self) -> Optional[str]: ...
@property
def callback(self) -> Callable[[AudioDevice, memoryview], None]: ...
@property
def frequency(self) -> int: ...
@property
def audioformat(self) -> int: ...
@property
def numchannels(self) -> int: ...
@property
def chunksize(self) -> int: ...
def pause(self, pause_on: int) -> None: ...
def close(self) -> None: ...
@@ -0,0 +1,34 @@
from typing import final
from pygame.joystick import JoystickType
from pygame.typing import ColorLike
def init() -> None: ...
def get_init() -> bool: ...
def quit() -> None: ...
def is_controller(device_index: int) -> bool: ...
def get_count() -> int: ...
@final
class Controller:
def __new__(cls, device_index: int) -> Controller: ...
def __init__(self, device_index: int) -> None: ...
@classmethod
def from_joystick(cls, joystick: JoystickType) -> Controller: ...
def get_init(self) -> bool: ...
def init(self) -> None: ...
def quit(self) -> None: ...
@property
def id(self) -> int: ...
@property
def name(self) -> str: ...
def attached(self) -> bool: ...
def as_joystick(self) -> JoystickType: ...
def get_axis(self, axis: int) -> int: ...
def get_button(self, button: int) -> bool: ...
def get_mapping(self) -> dict[str, str]: ...
def set_mapping(self, mapping: dict[str, str]) -> int: ...
def rumble(
self, low_frequency: float, high_frequency: float, duration: int
) -> bool: ...
def stop_rumble(self) -> None: ...
def set_led(self, color: ColorLike, /) -> bool: ...
@@ -0,0 +1,35 @@
from collections.abc import Mapping
from pygame.joystick import JoystickType
def init() -> None: ...
def get_init() -> bool: ...
def quit() -> None: ...
def set_eventstate(state: bool) -> None: ...
def get_eventstate() -> bool: ...
def update() -> None: ...
def get_count() -> int: ...
def is_controller(index: int) -> bool: ...
def name_forindex(index: int) -> str | None: ...
class Controller:
def __init__(self, index: int) -> None: ...
@property
def name(self) -> str: ...
@property
def id(self) -> int: ...
def init(self) -> None: ...
def get_init(self) -> bool: ...
def quit(self) -> None: ...
@staticmethod
def from_joystick(joy: JoystickType) -> Controller: ...
def attached(self) -> bool: ...
def as_joystick(self) -> JoystickType: ...
def get_axis(self, axis: int) -> int: ...
def get_button(self, button: int) -> bool: ...
def get_mapping(self) -> dict[str, str]: ...
def set_mapping(self, mapping: Mapping[str, str]) -> int: ...
def rumble(
self, low_frequency: float, high_frequency: float, duration: int
) -> bool: ...
def stop_rumble(self) -> None: ...
@@ -0,0 +1,14 @@
INIT_TIMER: int
INIT_AUDIO: int
INIT_VIDEO: int
INIT_JOYSTICK: int
INIT_HAPTIC: int
INIT_GAMECONTROLLER: int
INIT_EVENTS: int
INIT_NOPARACHUTE: int
INIT_EVERYTHING: int
class error(RuntimeError):
def __init__(self, message: str | None = None) -> None: ...
def init_subsystem(flags: int) -> None: ...
@@ -0,0 +1,12 @@
from typing import TypedDict
class _FingerDict(TypedDict):
id: int
x: float
y: float
pressure: float
def get_num_devices() -> int: ...
def get_device(index: int, /) -> int: ...
def get_num_fingers(device_id: int, /) -> int: ...
def get_finger(touchid: int, index: int) -> _FingerDict | None: ...
@@ -0,0 +1,159 @@
from collections.abc import Generator, Iterable
from typing import Any
from pygame.color import Color
from pygame.rect import Rect
from pygame.surface import Surface
from pygame.typing import ColorLike, Point, RectLike
from pygame.window import Window as Window
WINDOWPOS_UNDEFINED: int
WINDOWPOS_CENTERED: int
SCALEQUALITY_NEAREST: int
SCALEQUALITY_LINEAR: int
SCALEQUALITY_BEST: int
class RendererDriverInfo:
name: str
flags: int
num_texture_formats: int
max_texture_width: int
max_texture_height: int
def get_drivers() -> Generator[RendererDriverInfo, None, None]: ...
def get_grabbed_window() -> Window | None: ...
class Texture:
def __init__(
self,
renderer: Renderer,
size: Iterable[int],
depth: int = 0,
static: bool = False,
streaming: bool = False,
target: bool = False,
scale_quality: int | None = None,
) -> None: ...
@staticmethod
def from_surface(renderer: Renderer, surface: Surface) -> Texture: ...
renderer: Renderer
width: int
height: int
alpha: int
blend_mode: int
@property
def color(self) -> Color: ...
@color.setter
def color(self, value: ColorLike) -> None: ...
def get_rect(self, **kwargs: Any) -> Rect: ...
def draw(
self,
srcrect: RectLike | None = None,
dstrect: RectLike | None = None,
angle: float = 0.0,
origin: Iterable[int] | None = None,
flip_x: bool = False,
flip_y: bool = False,
) -> None: ...
def draw_triangle(
self,
p1_xy: Point,
p2_xy: Point,
p3_xy: Point,
p1_uv: Point = (0.0, 0.0),
p2_uv: Point = (1.0, 1.0),
p3_uv: Point = (0.0, 1.0),
p1_mod: Iterable[int] = (255, 255, 255, 255),
p2_mod: Iterable[int] = (255, 255, 255, 255),
p3_mod: Iterable[int] = (255, 255, 255, 255),
) -> None: ...
def draw_quad(
self,
p1_xy: Point,
p2_xy: Point,
p3_xy: Point,
p4_xy: Point,
p1_uv: Point = (0.0, 0.0),
p2_uv: Point = (1.0, 0.0),
p3_uv: Point = (1.0, 1.0),
p4_uv: Point = (0.0, 1.0),
p1_mod: Iterable[int] = (255, 255, 255, 255),
p2_mod: Iterable[int] = (255, 255, 255, 255),
p3_mod: Iterable[int] = (255, 255, 255, 255),
p4_mod: Iterable[int] = (255, 255, 255, 255),
) -> None: ...
def update(self, surface: Surface, area: RectLike | None = None) -> None: ...
class Image:
def __init__(
self,
texture_or_image: Texture | Image,
srcrect: RectLike | None = None,
) -> None: ...
def get_rect(self) -> Rect: ...
def draw(
self, srcrect: RectLike | None = None, dstrect: RectLike | None = None
) -> None: ...
angle: float
origin: Iterable[float] | None
flip_x: bool
flip_y: bool
alpha: float
blend_mode: int
texture: Texture
srcrect: Rect
@property
def color(self) -> Color: ...
@color.setter
def color(self, value: ColorLike) -> None: ...
class Renderer:
def __init__(
self,
window: Window,
index: int = -1,
accelerated: int = -1,
vsync: bool = False,
target_texture: bool = False,
) -> None: ...
@classmethod
def from_window(cls, window: Window) -> Renderer: ...
draw_blend_mode: int
@property
def draw_color(self) -> Color: ...
@draw_color.setter
def draw_color(self, value: ColorLike) -> None: ...
def clear(self) -> None: ...
def present(self) -> None: ...
def get_viewport(self) -> Rect: ...
def set_viewport(self, area: RectLike | None) -> None: ...
logical_size: Iterable[int]
def coordinates_to_window(self, point: Point) -> tuple[float, float]: ...
def coordinates_from_window(self, point: Point) -> tuple[float, float]: ...
scale: Iterable[float]
target: Texture | None
def blit(
self,
source: Texture | Image,
dest: RectLike | None = None,
area: RectLike | None = None,
special_flags: int = 0,
) -> Rect: ...
def draw_line(self, p1: Point, p2: Point) -> None: ...
def draw_point(self, point: Point) -> None: ...
def draw_rect(self, rect: RectLike) -> None: ...
def fill_rect(self, rect: RectLike) -> None: ...
def draw_triangle(self, p1: Point, p2: Point, p3: Point) -> None: ...
def fill_triangle(self, p1: Point, p2: Point, p3: Point) -> None: ...
def draw_quad(self, p1: Point, p2: Point, p3: Point, p4: Point) -> None: ...
def fill_quad(self, p1: Point, p2: Point, p3: Point, p4: Point) -> None: ...
def to_surface(
self, surface: Surface | None = None, area: RectLike | None = None
) -> Surface: ...
@staticmethod
def compose_custom_blend_mode(
color_mode: tuple[int, int, int], alpha_mode: tuple[int, int, int]
) -> int: ...
@@ -0,0 +1 @@
from .video import Window # pylint: disable=wildcard-import
@@ -0,0 +1 @@
from pygame._sdl2.video import Window as Window