Skip to content

Camera effects ​

This page is part of the GenPy Ren'Py learning path. It focuses on practical Ren'Py 8.x production and links each concept back to the GenPy workflow.

Learning goals ​

  • Use camera motion to support story beats.
  • Keep shake and flash effects comfortable for players.
  • Reuse transforms for consistent presentation.

Core syntax ​

  • shake
  • zoom
  • Ken Burns
  • flash
  • vignette
  • letterbox

Runnable example ​

text
init python:
    import random
    def make_shake(intensity=12, duration=0.5):
        def f(trans, st, at):
            if st >= duration:
                trans.xoffset = 0
                trans.yoffset = 0
                return None                  # 结束,复位
            # 随时间衰减的随机抖动
            decay = 1.0 - (st / duration)
            trans.xoffset = random.randint(-intensity, intensity) * decay
            trans.yoffset = random.randint(-intensity, intensity) * decay
            return 0
        return f

transform big_shake:
    function make_shake(24, 0.6)

label boom:
    show eileen happy at big_shake
    # 给整层震动更震撼:
    show layer master at big_shake
    "地动山摇!"

Study outline ​

  • Start with the smallest example for camera effects.
  • Test the key terms in a clean Ren'Py project: shake, zoom, Ken Burns, flash.
  • Move the pattern back into your real project only after the example runs.
  • Use GenPy docs and validation to keep the feature connected to story, assets, and export readiness.

Common pitfalls ​

  • Test the smallest working script before layering on visual or UI complexity.
  • Run Ren'Py Lint before release builds, even when the script appears to run locally.
  • Keep examples in standard .rpy files so they remain editable outside GenPy.

Official references ​

How this fits in GenPy ​

  • Use Performance Editor for beat timing and Code mode for reusable transforms.
  • Preview accessibility-sensitive effects before release.

Recommended GenPy docs:

Built for GenPy creators.