mini_arcade_core.engine.render.effects.base¶
Screen-space post effects base classes and protocols.
Classes¶
Screen-space post effect. |
|
Shared params (Material-ish controls) for v1. |
|
Runtime state: what effects are enabled + their params. |
Module Contents¶
- class mini_arcade_core.engine.render.effects.base.Effect¶
Bases:
ProtocolScreen-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:
- 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.