Skip to content

Displace

examples/displace_effect.py
from keyed import Rectangle, Scene

from keyed_extras import Displace, stipple_pattern

s = Scene(width=800, height=800)

r = Rectangle(s, width=100, height=100, line_width=2).scale(4)
r.fill_pattern = stipple_pattern(size=100, dot_radius=1.5, density=0.9)
s.add(r)

smooth_displace = Displace(amplitude=5, frequency=0.1, seeth=s.frame / 8)
s.default_layer.apply_effect(smooth_displace)