from __future__ import annotations
from typing import Any, Iterator, Sequence
class Signal:
def emit(self, *values: object) -> None: ...
def connect(self, handler: object) -> None: ...
def signal(*types: object) -> Signal: ...
class Vec2:
x: float
y: float
def __init__(self, x: float = 0.0, y: float = 0.0) -> None: ...
def __add__(self, other: Vec2 | tuple[float, float]) -> Vec2: ...
def __sub__(self, other: Vec2 | tuple[float, float]) -> Vec2: ...
def __mul__(self, scalar: float) -> Vec2: ...
def __rmul__(self, scalar: float) -> Vec2: ...
def __truediv__(self, scalar: float) -> Vec2: ...
def __iadd__(self, other: Vec2 | tuple[float, float]) -> Vec2: ...
def __isub__(self, other: Vec2 | tuple[float, float]) -> Vec2: ...
def __imul__(self, scalar: float) -> Vec2: ...
def __itruediv__(self, scalar: float) -> Vec2: ...
def __len__(self) -> int: ...
def __getitem__(self, idx: int) -> float: ...
def __setitem__(self, idx: int, val: float) -> None: ...
def __iter__(self) -> Iterator[float]: ...
def length(self) -> float: ...
def normalized(self) -> Vec2: ...
def to_tuple(self) -> tuple[float, float]: ...
class InputQuery:
def __getattr__(self, name: str) -> bool: ...
held: InputQuery
pressed: InputQuery
released: InputQuery
def mouse() -> Vec2: ...
def frames(atlas: str) -> list[str]: ...
def play(path: str, volume: float = ...) -> int: ...
def stop(id: int) -> None: ...
def set_volume(id: int, volume: float) -> None: ...
def is_playing(id: int) -> bool: ...
def child(name: str) -> Any: ...
def node(path: str) -> Any: ...
def raycast(from_pos: tuple[float, float] | Vec2, to_pos: tuple[float, float] | Vec2, mask: int = ...) -> dict[str, Any] | None: ...
class Node:
node_path: str
def get_node(self, path: str) -> Node: ...
def _ready(self) -> None: ...
def _process(self, delta: float) -> None: ...
def _physics_process(self, delta: float) -> None: ...
def __getattr__(self, name: str) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...
class Node2D(Node):
position: Vec2
class Sprite2D(Node2D):
texture: str
atlas: str
frame: str
class Camera2D(Node2D): ...
class Timer(Node):
wait_time: float
timeout: Signal
class Label(Node):
text: str
class Button(Node2D):
text: str
size: Vec2
pressed: Signal
class StaticBody2D(Node2D):
collision_layer: int
collision_mask: int
class CharacterBody2D(Node2D):
velocity: Vec2
up_direction: Vec2
collision_layer: int
collision_mask: int
def is_on_floor(self) -> bool: ...
def is_on_wall(self) -> bool: ...
def is_on_ceiling(self) -> bool: ...
def move_and_slide(self) -> bool: ...
class RigidBody2D(Node2D):
mass: float
gravity_scale: float
restitution: float
friction: float
lock_rotation: bool
collision_layer: int
collision_mask: int
def apply_impulse(self, impulse: tuple[float, float] | Vec2) -> None: ...
def apply_force(self, force: tuple[float, float] | Vec2) -> None: ...
class Area2D(Node2D):
collision_layer: int
collision_mask: int
body_entered: Signal
body_exited: Signal
area_entered: Signal
area_exited: Signal
class CollisionShape2D(Node2D):
shape: str
size: tuple[float, float]
radius: float
height: float
disabled: bool