overlay show function in renpy?

Forum organization and occasional community-building.
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
pinkcateye
Newbie
Posts: 8
Joined: Mon Oct 30, 2023 4:58 pm

overlay show function in renpy?

#1 Post by pinkcateye »

I'm trying to make an overlay function for my game in renpy. everything works except the transition part. whenever i run this in my game, it says "TypeError: __init__() got multiple values for argument 'transition'". any help is appreciated, thank you! :mrgreen:

Code: Select all

init python:
	class overlay:
        	def show(img,trans=None):
            		Show("overlayscreen", img, transition=trans)
        	def kill(trans=None):
            		Hide("overlayscreen", transition=trans)
            		
screen overlayscreen(img):
    zorder 100
    add "[img]"
            		
label start:
	scene bg room
	$ overlay.show("images/overlay/vignette.png")
	"this is a nice vignette!"
	return
            		

User avatar
pinkcateye
Newbie
Posts: 8
Joined: Mon Oct 30, 2023 4:58 pm

Re: overlay show function in renpy?

#2 Post by pinkcateye »

Update: i got it working. :)

Code: Select all

init python:
	class overlay:
        	def show(img,trans=None):
            		renpy.show_screen("overlay",img)
            		renpy.transition(trans)
        	def kill(trans=None):
            		renpy.hide_screen("overlay",)
            		renpy.transition(trans)
            		
screen overlayscreen(img):
    zorder 100
    add "[img]"
            		
label start:
	scene bg room
	$ overlay.show("images/overlay/vignette.png")
	"this is a nice vignette!"
	return

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]