Skip to content

Instantly share code, notes, and snippets.

@midgethetree
midgethetree / 0scrollbutton_ren.py
Last active February 27, 2024 20:57
Scrollbutton code for the Ren'Py visual novel engine.
"""renpy
init offset = -2
python early:
"""
# The scrollbutton will automatically hide itself when the viewport it's associated with cannot be scrolled.
class ScrollButton(renpy.display.behavior.Button):
def __init__(self, *args, **kwargs):
@midgethetree
midgethetree / 0parallax.rpy
Last active October 17, 2024 16:32
Parallax code for the Ren'Py visual novel engine.
python early:
class ParallaxLayer(renpy.Displayable):
def __init__(self, child, xmotion, ymotion, replaces=None, **kwargs):
super(ParallaxLayer, self).__init__(**kwargs)
self.child = renpy.displayable(child)
self.xmotion, self.ymotion = xmotion, ymotion