mini_arcade_core.engine.render.effects.base =========================================== .. py:module:: mini_arcade_core.engine.render.effects.base .. autoapi-nested-parse:: Screen-space post effects base classes and protocols. Classes ------- .. autoapisummary:: mini_arcade_core.engine.render.effects.base.Effect mini_arcade_core.engine.render.effects.base.EffectParams mini_arcade_core.engine.render.effects.base.EffectStack Module Contents --------------- .. py:class:: Effect Bases: :py:obj:`Protocol` Screen-space post effect. IMPORTANT: Effects should draw ONLY using ctx.viewport (screen-space), and must not assume anything about world-space transforms. .. py:attribute:: effect_id :type: str .. py:method:: apply(backend: mini_arcade_core.backend.Backend, ctx: mini_arcade_core.engine.render.context.RenderContext) Apply the effect to the current framebuffer. :param backend: Backend to use for rendering. :type backend: Backend :param ctx: Render context with viewport info. :type ctx: RenderContext .. py:class:: EffectParams Shared params (Material-ish controls) for v1. :ivar intensity (float): Effect intensity. :ivar wobble_speed (float): Speed factor for animated distortion. :ivar tint (tuple[int, int, int, int] | None): Optional RGBA tint. .. py:attribute:: intensity :type: float :value: 1.0 .. py:attribute:: wobble_speed :type: float :value: 1.0 .. py:attribute:: tint :type: tuple[int, int, int, int] | None :value: None .. py:class:: EffectStack Runtime state: what effects are enabled + their params. Zero-overhead path: - if enabled=False OR active is empty => PostFXPass returns immediately. :ivar enabled (bool): Master toggle for post effects. :ivar active (list[str]): List of active effect IDs. :ivar params (dict[str, EffectParams]): Per-effect parameters. .. py:attribute:: enabled :type: bool :value: False .. py:attribute:: active :type: list[str] :value: [] .. py:attribute:: params :type: dict[str, EffectParams] .. py:method:: is_active() -> bool Check if any effects are active. :return: True if effects are enabled and at least one is active. :rtype: bool .. py:method:: toggle(effect_id: str) Toggle an effect on/off. :param effect_id: ID of the effect to toggle. :type effect_id: str