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
| Property | Type | Description |
|---|---|---|
render.enabled | bool | When False, all effects are bypassed and the screen is presented unmodified. |
Effects
Each effect is an object with the same two properties:
| Property | Type | Description |
|---|---|---|
enabled | bool | Turns this effect on or off. |
intensity | float | Strength of the effect, 0.0–1.0. |
| Effect | What it does |
|---|---|
render.bloom | Soft glow around bright pixels. |
render.scanlines | Darkens alternate rows for a CRT look. |
render.curvature | Slight barrel distortion (screen curve). |
render.vignette | Darkens the edges of the screen. |
render.aberration | Chromatic 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.