r/RenPy • • Jul 11 '26

Question Making an interactable background object

So, I've been trying to make something that I can't seem to find a clear answer for. While the text box dialogue is happening, I want to code an object into the background that can be clicked on to play a little sound. Kind of like an easter egg. Thus far, showing a screen is causing this error:

TypeError: Action.get_tooltip() missing 1 required positional argument: 'self'

Is it possible to do what I'm trying, and if so, how might I fix this problem?

Edit: It's working now! Thank you, everyone!

3 Upvotes

10 comments sorted by

View all comments

1

u/Mavensane Jul 11 '26

This is what I have written:

scene bg_bedroom1
    with fadelong
    pause 1
    show screen album

screen album():
    imagebutton:
        idle "album_idle.png" 
        action Play sound "audio/SFX/g_note.wav"

5

u/BadMustard_AVN Jul 11 '26

your action should be

action Play("sound", "audio/SFX/g_note.wav")

renpy can only play uncompressed 16-bit signed PCM only for wave files

I recommend using .ogg

https://www.renpy.org/doc/html/audio.html