pyxen.render

The render module controls Pyxen’s post-process screen effects. Each effect can be toggled on or off and given a 0.0–1.0 intensity, live from your game code. Effects are off by default, so games look exactly as drawn until you opt in.

from pyxen import *

render.enabled = True            # master switch for all effects

render.bloom.enabled = True
render.bloom.intensity = 0.4

render.scanlines.enabled = True
render.scanlines.intensity = 0.5

Master toggle

PropertyTypeDescription
render.enabledboolWhen False, all effects are bypassed and the screen is presented unmodified.

Effects

Each effect is an object with the same two properties:

PropertyTypeDescription
enabledboolTurns this effect on or off.
intensityfloatStrength of the effect, 0.0–1.0.
EffectWhat it does
render.bloomSoft glow around bright pixels.
render.scanlinesDarkens alternate rows for a CRT look.
render.curvatureSlight barrel distortion (screen curve).
render.vignetteDarkens the edges of the screen.
render.aberrationChromatic aberration — splits the colour channels.
def update():
    # Pulse the vignette with a low-health warning.
    if player.health < 3:
        render.vignette.enabled = True
        render.vignette.intensity = 0.6
    else:
        render.vignette.enabled = False

Project defaults

Effects can also be configured in Project Settings → Render Effects, which sets the defaults a game starts with. The in-preview View Settings panel lets you tweak effects live and save them back as the project default.

Changing render.* from code overrides the project defaults for the running game; it does not modify the saved project.