mini_arcade_core.engine.render.effects.base

Screen-space post effects base classes and protocols.

Classes

Effect

Screen-space post effect.

EffectParams

Shared params (Material-ish controls) for v1.

EffectStack

Runtime state: what effects are enabled + their params.

Module Contents

class mini_arcade_core.engine.render.effects.base.Effect

Bases: Protocol

Screen-space post effect.

IMPORTANT: Effects should draw ONLY using ctx.viewport (screen-space), and must not assume anything about world-space transforms.

effect_id: str
apply(backend: mini_arcade_core.backend.Backend, ctx: mini_arcade_core.engine.render.context.RenderContext)

Apply the effect to the current framebuffer.

Parameters:
  • backend (Backend) – Backend to use for rendering.

  • ctx (RenderContext) – Render context with viewport info.

class mini_arcade_core.engine.render.effects.base.EffectParams

Shared params (Material-ish controls) for v1.

Variables:
  • (float) (wobble_speed) – Effect intensity.

  • (float) – Speed factor for animated distortion.

  • None) (tint (tuple[int, int, int, int] |) – Optional RGBA tint.

intensity: float = 1.0
wobble_speed: float = 1.0
tint: tuple[int, int, int, int] | None = None
class mini_arcade_core.engine.render.effects.base.EffectStack

Runtime state: what effects are enabled + their params.

Zero-overhead path:
  • if enabled=False OR active is empty => PostFXPass returns immediately.

Variables:
  • (bool) (enabled) – Master toggle for post effects.

  • (list[str]) (active) – List of active effect IDs.

  • EffectParams]) (params (dict[str,) – Per-effect parameters.

enabled: bool = False
active: list[str] = []
params: dict[str, EffectParams]
is_active() bool

Check if any effects are active.

Returns:

True if effects are enabled and at least one is active.

Return type:

bool

toggle(effect_id: str)

Toggle an effect on/off.

Parameters:

effect_id (str) – ID of the effect to toggle.