Legacy follow modes – kept for backward compatibility.
Internally mapped to FollowStrategy instances.
FIXED: Any = 'fixed'
FOLLOW: Any = 'follow'
PLATFORMER: Any = 'platformer'
TOPDOWN: Any = 'topdown'
No methods defined.
Type of camera shake effect.
POSITIONAL: Any = 'positional'
ROTATIONAL: Any = 'rotational'
TRAUMA: Any = 'trauma'
No methods defined.
Easing functions for smooth camera movement.
LINEAR: Any = 'linear'
SMOOTHSTEP: Any = 'smoothstep'
QUADRATIC_IN: Any = 'quadratic_in'
QUADRATIC_OUT: Any = 'quadratic_out'
QUADRATIC_IN_OUT: Any = 'quadratic_in_out'
CUBIC_IN: Any = 'cubic_in'
CUBIC_OUT: Any = 'cubic_out'
CUBIC_IN_OUT: Any = 'cubic_in_out'
No methods defined.
Abstract base class for camera follow behaviours.
def get_target_position(self: Any, camera: 'Camera', dt: float) -> pygame.Vector2
Follow the target's world position directly.
def get_target_position(self: Any, camera: 'Camera', dt: float) -> pygame.Vector2
Keep the camera at a fixed world position, ignoring the target.
def __init__(self: Any, fixed_position: Union[Tuple[float, float], pygame.Vector2]) -> Any
def get_target_position(self: Any, camera: 'Camera', dt: float) -> pygame.Vector2
Platformer-style camera with a deadzone in screen space.
The camera moves only when the target leaves the deadzone rectangle.
def __init__(self: Any, deadzone_rect: Optional[pygame.Rect] = None) -> Any
def get_target_position(self: Any, camera: 'Camera', dt: float) -> pygame.Vector2
Top-down RPG style camera with look‑ahead based on target velocity/direction.
def __init__(self: Any, lead_factor: float = 0.3) -> Any
def get_target_position(self: Any, camera: 'Camera', dt: float) -> pygame.Vector2
Limits applied to camera movement and zoom.
min_zoom: float = 0.1
max_zoom: float = 10.0
bounds: Optional[pygame.Rect] = None
rotation_range: Tuple[float, float] = (-180.0, 180.0)
No methods defined.
Base class for temporary camera effects (shake, fade, flash, etc.).
def update(self: Any, dt: float) -> bool
def apply(self: Any, camera: 'Camera') -> None
Positional or rotational shake with intensity decay.
def __init__(self: Any, intensity: float = 1.0, duration: float = 0.5, shake_type: CameraShakeType = CameraShakeType.POSITIONAL) -> Any
def update(self: Any, dt: float) -> bool
def apply(self: Any, camera: 'Camera') -> None
Trauma‑based shake – intensity scales with trauma^2.
def __init__(self: Any, trauma: float = 1.0, decay_rate: float = 1.5) -> Any
def update(self: Any, dt: float) -> bool
def apply(self: Any, camera: 'Camera') -> None
A single parallax layer with tile support.
def __init__(self: Any, surface: pygame.Surface, speed_factor: float, tile_mode: bool = True, offset: Tuple[float, float] = (0, 0)) -> Any
def update(self: Any, camera_position: pygame.Vector2, dt: float) -> Any
def render(self: Any, camera: 'Camera', renderer: Any) -> None
def _draw_surface(self: Any, renderer: Any, surface: pygame.Surface, x: int, y: int) -> Any
Collection of parallax layers with optional caching.
def __init__(self: Any, camera: 'Camera') -> Any
def add_layer(self: Any, surface: pygame.Surface, speed_factor: float, tile_mode: bool = True, offset: Tuple[float, float] = (0, 0)) -> ParallaxLayer
def remove_layer(self: Any, layer: ParallaxLayer) -> Any
def clear_layers(self: Any) -> Any
def update(self: Any, dt: float) -> Any
def render(self: Any, renderer: Any) -> bool
Advanced 2D Camera with unified coordinate system (position = viewport center).
Supports multiple follow strategies, constraints, effects, and parallax.
def __init__(self: Any, scene: 'Scene', width: int, height: int) -> Any
def position(self: Any) -> pygame.Vector2
def position(self: Any, value: Any) -> Any
def base_position(self: Any) -> pygame.Vector2
def mode(self: Any) -> CameraMode
def mode(self: Any, value: CameraMode) -> Any
def viewport_rect(self: Any) -> pygame.Rect
def set_target(self: Any, target: Any, mode: Optional[CameraMode] = None) -> Any
def set_follow_strategy(self: Any, strategy: FollowStrategy) -> Any
def set_bounds(self: Any, bounds: pygame.Rect) -> Any
def set_zoom(self: Any, zoom: float, smooth: bool = True) -> Any
def shake(self: Any, intensity: float = 1.0, duration: float = 0.5, shake_type: CameraShakeType = CameraShakeType.POSITIONAL) -> Any
def add_trauma(self: Any, amount: float) -> Any
def add_effect(self: Any, effect: CameraEffect) -> Any
def remove_effect(self: Any, effect: CameraEffect) -> Any
def clear_effects(self: Any) -> Any
def update(self: Any, dt: float) -> Any
def _apply_smooth_movement(self: Any, dt: float) -> Any
def _apply_smooth_zoom(self: Any, dt: float) -> Any
def _update_effects(self: Any, dt: float) -> Any
def _apply_constraints(self: Any) -> Any
def _update_viewport_rect(self: Any) -> Any
def _update_renderer_camera_position(self: Any) -> Any
def world_to_screen(self: Any, world_pos: Union[Tuple[float, float], pygame.Vector2, List[float], np.ndarray]) -> pygame.Vector2
def world_to_screen_list(self: Any, world_positions: List, return_type: str = 'list') -> Any
def screen_to_world(self: Any, screen_pos: Union[Tuple[float, float], pygame.Vector2, List[float], np.ndarray]) -> pygame.Vector2
def screen_to_world_list(self: Any, screen_positions: List) -> List[pygame.Vector2]
def screen_to_world_vector(self: Any, screen_vec: Union[Tuple[float, float], pygame.Vector2]) -> pygame.Vector2
def convert_size_zoom(self: Any, size: Union[Tuple[float, float], List[float], float, pygame.Vector2]) -> Any
def convert_size_zoom_list(self: Any, sizes: List, return_type: str = 'list') -> Any
def get_visible_rect(self: Any) -> pygame.Rect
def is_visible(self: Any, world_pos: Union[Tuple[float, float], pygame.Vector2], margin: float = 0.0) -> bool
def _get_target_position(self: Any) -> pygame.Vector2
def add_parallax_layer(self: Any, surface: pygame.Surface, speed_factor: float, tile_mode: bool = True, offset: Tuple[float, float] = (0, 0)) -> ParallaxLayer
def remove_parallax_layer(self: Any, layer: ParallaxLayer) -> Any
def clear_parallax_layers(self: Any) -> Any
def render_parallax(self: Any, renderer: Any) -> bool
def enable_parallax(self: Any, enabled: bool = True) -> Any
def get_parallax_layer_count(self: Any) -> int
def _interpolate_linear(start: float, end: float, t: float) -> float
No documentation
def _interpolate_smoothstep(start: float, end: float, t: float) -> float
No documentation
def _interpolate_quadratic_in(start: float, end: float, t: float) -> float
No documentation
def _interpolate_quadratic_out(start: float, end: float, t: float) -> float
No documentation
def _interpolate_quadratic_in_out(start: float, end: float, t: float) -> float
No documentation
def _interpolate_cubic_in(start: float, end: float, t: float) -> float
No documentation
def _interpolate_cubic_out(start: float, end: float, t: float) -> float
No documentation
def _interpolate_cubic_in_out(start: float, end: float, t: float) -> float
No documentation
def interpolate(start: Union[float, pygame.Vector2], end: Union[float, pygame.Vector2], t: float, itype: InterpolationType = InterpolationType.LINEAR) -> Union[float, pygame.Vector2]
Interpolate between start and end using the specified easing function.