Enumeration of all available post-processing filter types.
NONE: Any = 'none'
VIGNETTE: Any = 'vignette'
BLUR: Any = 'blur'
SEPIA: Any = 'sepia'
GRAYSCALE: Any = 'grayscale'
INVERT: Any = 'invert'
TEMPERATURE_WARM: Any = 'temperature_warm'
TEMPERATURE_COLD: Any = 'temperature_cold'
NIGHT_VISION: Any = 'night_vision'
CRT: Any = 'crt'
PIXELATE: Any = 'pixelate'
BLOOM: Any = 'bloom'
EDGE_DETECT: Any = 'edge_detect'
EMBOSS: Any = 'emboss'
SHARPEN: Any = 'sharpen'
POSTERIZE: Any = 'posterize'
NEON: Any = 'neon'
RADIAL_BLUR: Any = 'radial_blur'
FISHEYE: Any = 'fisheye'
TWIRL: Any = 'twirl'
No methods defined.
Defines the shape/region where a filter is applied.
FULLSCREEN: Any = 'fullscreen'
RECTANGLE: Any = 'rectangle'
CIRCLE: Any = 'circle'
No methods defined.
Represents a post-processing filter with configurable region and intensity.
Attributes:
filter_type (FilterType): The type of effect to apply.
intensity (float): Strength of the effect (0.0 to 1.0).
region_type (FilterRegionType): Shape of the affected area.
region_pos (Tuple[float, float]): Position (top‑left for rect, center for circle).
region_size (Tuple[float, float]): Width and height of rectangular region.
radius (float): Radius for circular regions.
feather (float): Edge softness in pixels.
blend_mode (str): How the filter blends with the background (e.g., "normal").
enabled (bool): Whether this filter is active.
time (float): Accumulated time for animated filters.
def __init__(self: Any, filter_type: FilterType = FilterType.NONE, intensity: float = 1.0, region_type: FilterRegionType = FilterRegionType.FULLSCREEN, region_pos: Tuple[float, float] = (0, 0), region_size: Tuple[float, float] = (100, 100), radius: float = 50.0, feather: float = 10.0, blend_mode: str = 'normal') -> Any
def update(self: Any, dt: float) -> None
def copy(self: Any) -> Filter
Base shader program that loads from combined shader files using macros.
The shader source is taken from one of these (in order of priority):
1. A dedicated file named '<shader_name>.vert' (or .frag/.geom) in the shader folder.
2. A combined file 'shaders.vert' (or .frag/.geom) with a #define for the shader name.
3. A raw string passed directly (if it contains '#version').
This allows both compact distribution and per‑shader overrides.
def __init__(self: Any, shader_name: str, has_geometry: bool = False) -> Any
def _load_source(self: Any, stage: str) -> Optional[str]
def _get_uniform_location(self: Any, name: str) -> int
def _create_program(self: Any, vertex_source: str, fragment_source: str, geometry_source: Optional[str] = None) -> None
def use(self: Any) -> None
def unuse(self: Any) -> None
def _setup_geometry(self: Any) -> None
No documentation
def __init__(self: Any) -> Any
def _setup_geometry(self: Any) -> None
No documentation
def __init__(self: Any) -> Any
def _setup_geometry(self: Any) -> None
No documentation
def __init__(self: Any) -> Any
def _setup_geometry(self: Any) -> None
No documentation
def __init__(self: Any) -> Any
def _setup_geometry(self: Any) -> None
No documentation
def __init__(self: Any) -> Any
def _setup_geometry(self: Any) -> None
No documentation
def __init__(self: Any) -> Any
def _setup_geometry(self: Any) -> None
No documentation
def __init__(self: Any) -> Any
def _setup_geometry(self: Any) -> None
Main hardware‑accelerated renderer for LunaEngine.
camera_position: Any = pygame.math.Vector2(0, 0)
def __init__(self: Any, width: int, height: int) -> Any
def get_opengl_version(self: Any) -> str
def set_text_cache_timeout(self: Any, seconds: float) -> None
def get_cache_usage(self: Any, target: str = 'all', humanize: bool = False) -> Any
def max_particles(self: Any) -> int
def max_particles(self: Any, value: int) -> None
def initialize(self: Any) -> bool
def _initialize_filter_framebuffer(self: Any) -> bool
def add_filter(self: Any, filter_obj: Filter) -> None
def remove_filter(self: Any, filter_obj: Filter) -> None
def clear_filters(self: Any) -> None
def create_quick_filter(self: Any, filter_type: FilterType, intensity: float = 1.0, x: float = 0, y: float = 0, width: float = None, height: float = None, radius: float = 50.0, feather: float = 10.0) -> Filter
def apply_vignette(self: Any, intensity: float = 0.7, feather: float = 100.0) -> Filter
def apply_blur(self: Any, intensity: float = 0.5, x: float = 0, y: float = 0, width: float = None, height: float = None) -> Filter
def apply_sepia(self: Any, intensity: float = 1.0) -> Filter
def apply_grayscale(self: Any, intensity: float = 1.0) -> Filter
def apply_invert(self: Any, intensity: float = 1.0) -> Filter
def apply_warm_temperature(self: Any, intensity: float = 0.5) -> Filter
def apply_cold_temperature(self: Any, intensity: float = 0.5) -> Filter
def apply_night_vision(self: Any, intensity: float = 0.9) -> Filter
def apply_crt_effect(self: Any, intensity: float = 0.8) -> Filter
def apply_pixelate(self: Any, intensity: float = 0.7) -> Filter
def apply_bloom(self: Any, intensity: float = 0.5) -> Filter
def apply_edge_detect(self: Any, intensity: float = 0.8) -> Filter
def apply_emboss(self: Any, intensity: float = 0.7) -> Filter
def apply_sharpen(self: Any, intensity: float = 0.5) -> Filter
def apply_posterize(self: Any, intensity: float = 0.6) -> Filter
def apply_neon(self: Any, intensity: float = 0.7) -> Filter
def apply_radial_blur(self: Any, intensity: float = 0.5) -> Filter
def apply_fisheye(self: Any, intensity: float = 0.4) -> Filter
def apply_twirl(self: Any, intensity: float = 0.3) -> Filter
def apply_circular_grayscale(self: Any, center_x: float, center_y: float, radius: float = 100.0, intensity: float = 1.0) -> Filter
def apply_rectangular_blur(self: Any, x: float, y: float, width: float, height: float, intensity: float = 0.5) -> Filter
def begin_frame(self: Any) -> None
def end_frame(self: Any) -> None
def _apply_filters(self: Any) -> None
def get_surface(self: Any) -> pygame.Surface
def set_surface(self: Any, surface: Optional[pygame.Surface]) -> None
def _surface_to_texture(self: Any, surface: pygame.Surface) -> int
def _surface_to_texture_cached(self: Any, surface: pygame.Surface, rect: Optional[pygame.Rect] = None, dest: Optional[pygame.Rect] = None, flags: int = 0) -> int
def _convert_color(self: Any, color: Any) -> Any
def _read_texture_pixel(self: Any, tex_id: int, x: int = 0, y: int = 0) -> Tuple[int, int, int, int]
def enable_scissor(self: Any, x: Any, y: Any, width: Any, height: Any) -> Any
def disable_scissor(self: Any) -> Any
def draw_rect(self: Any, x: Any, y: Any, width: Any, height: Any, color: Any = None, fill: Any = True, pivot: Any = (0.0, 0.0), border_width: Any = 1, surface: Any = None, corner_radius: Any = 0, border_color: Any = None, style: Optional[Dict[str, Any]] = None) -> Any
def _draw_rect_fast(self: Any, x: Any, y: Any, width: Any, height: Any, color: Any, fill: Any = True, border_width: Any = 1, corner_radius: Any = 0, border_color: Any = None) -> Any
def _draw_outline_rect(self: Any, x: Any, y: Any, width: Any, height: Any, color: Any, border_width: Any, radii: Any) -> Any
def _draw_sharp_rect(self: Any, x: Any, y: Any, width: Any, height: Any, color: Any, fill: Any = True, border_width: Any = 1) -> Any
def _draw_rounded_rect(self: Any, x: Any, y: Any, w: Any, h: Any, color: Any, fill: Any = True, border_width: Any = 1, radii: Any = (0, 0, 0, 0)) -> Any
def draw_isosceles_triangle(self: Any, x: Any, y: Any, width: Any, height: Any, color: Any = None, fill: Any = True, border_width: Any = 1, border_color: Any = None, style: Optional[Dict[str, Any]] = None) -> Any
def draw_equilateral_triangle(self: Any, x: Any, y: Any, width: Any, color: Any = None, fill: Any = True, border_width: Any = 1, border_color: Any = None, style: Optional[Dict[str, Any]] = None) -> Any
def draw_line(self: Any, start_x: Any, start_y: Any, end_x: Any, end_y: Any, color: Any, width: Any = 2, surface: Any = None) -> Any
def _draw_thick_line(self: Any, x1: Any, y1: Any, x2: Any, y2: Any, color: Any, width: Any) -> Any
def draw_lines(self: Any, points: Any, color: Any, width: Any = 2, surface: Any = None) -> Any
def draw_circle(self: Any, center_x: Any, center_y: Any, radius: Any, color: Any = None, fill: Any = True, border_width: Any = 1, surface: Any = None, pivot: Any = (0.5, 0.5), style: Optional[Dict[str, Any]] = None) -> Any
def _draw_circle_fast(self: Any, center_x: Any, center_y: Any, radius: Any, color: Any, fill: Any = True, border_width: Any = 1, pivot: Any = (0.5, 0.5)) -> Any
def _generate_filled_circle_geometry(self: Any, segments: Any) -> Any
def _generate_hollow_circle_geometry(self: Any, segments: Any, border_width: Any, radius: Any) -> Any
def _upload_geometry(self: Any, vertices: Any, indices: Any) -> Any
def draw_polygon(self: Any, points: Any, color: Any = None, fill: Any = True, border_width: Any = 1, surface: Any = None, pivot: Any = (0.0, 0.0), style: Optional[Dict[str, Any]] = None) -> Any
def _generate_filled_polygon_geometry(self: Any, points: Any) -> Any
def _generate_hollow_polygon_geometry(self: Any, points: Any, border_width: Any) -> Any
def _draw_polygon_fast(self: Any, points: Any, color: Any, fill: Any = True, border_width: Any = 1, pivot: Any = (0.0, 0.0)) -> Any
def draw_text(self: Any, text: str, x: int, y: int, color: Any, font: pygame.font.Font, surface: Optional[pygame.Surface] = None, pivot: Tuple[float, float] = (0.0, 0.0), flip: Tuple[bool, bool] = (False, False), rotate: float = 0.0, style: Optional[Dict] = None, *args: tuple, **kwargs: dict) -> None
def draw_rich_text(self: Any, text: Any, x: Any, y: Any, default_color: Any, font: Any, surface: Any = None, pivot: Any = (0.0, 0.0), **kwargs: dict) -> Any
def draw_rich_text_line(self: Any, line: Any, x: Any, y: Any, default_color: Any, font: Any, surface: Any = None) -> Any
def _cleanup_text_cache(self: Any, now: float) -> Any
def _cleanup_texture_cache(self: Any, time_dur: Any = 5.0, force_cleanup: Any = False) -> Any
def draw_surface(self: Any, surface: Any, x: Any, y: Any, pivot: Any = (0.0, 0.0), use_cache: Any = True) -> Any
def blit(self: Any, source: Any, dest: Any, area: Any = None, special_flags: Any = 0, pivot: Any = (0.0, 0.0), use_cache: Any = True) -> Any
def fill_screen(self: Any, color: Any) -> Any
def clear(self: Any) -> Any
def render_particles(self: Any, particle_data: Any, camera: Any) -> Any
def _ensure_particle_capacity(self: Any, required: Any) -> Any
def _ensure_temp_fbo(self: Any, width: int, height: int) -> None
def _generate_gradient_texture(self: Any, color_keys: Any, width: int, height: int, gradient_type: str = 'linear', angle: float = 0.0) -> int
def _apply_blur_to_texture(self: Any, tex_id: int, width: int, height: int, intensity: float) -> int
def _apply_shadow_to_shape(self: Any, mask_tex: int, width: int, height: int, shadow_params: Dict) -> Tuple[int, int, int]
def cleanup(self: Any) -> Any
def set_blend_mode(self: Any, mode: str) -> Any
def set_shader_folder(folder: str) -> None
Set the base folder where shader files are located.
This affects all ShaderProgram instances that load shader files by relative name.
Args:
folder: Absolute path to the shader folder.
def get_shader_folder() -> str
Return the current shader folder path.