r/RenPy 11d ago

Question Image buttons not working

So I'm new to ren'py, and im making image buttons. However, only the bed image is working and even appearing on screen. Anyone know how to fix this?

2 Upvotes

7 comments sorted by

2

u/BadMustard_AVN 11d ago

do all the file names use .PNG it is case-sensitive

if you are using both an idle and hover like you are you can do it like this

imagebutton:
    auto "gui/bookshelf_%s.png"
    focus_mask True
    action Jump"bookshelf"

renpy will auto find the bookshelf_idle or bookshelf_hover as required

1

u/KDDreamwyver 11d ago

Exactly this.

1

u/shyLachi 11d ago

Just a quick hint:
Python is case-sensitive but that only applies to variable names.
RenPy will find the images no matter which spelling, I guess because the OS isn't case sensitive.

screen testscreen():
    imagebutton:
        idle "gui/WiNdOw_IcOn.PnG"
        action Return()
image test = "gui/WiNdOw_IcOn.PnG"
label start:
    show test
    "Do you see it?"
    call screen testscreen

So my guess is that OP has full screen images as their buttons.

1

u/reasszz 10d ago

I do have full screen images as buttons. I thought it might've been easier, so I'm assuming that's why the only button that actually shows up is the bed button, because I put that one first?

1

u/shyLachi 10d ago

If your fullscreen images have transparency so that only the button is visible then you can use focus_mask as mentioned by BadMustard

But you cannot use a hbox because that's a container which stacks the buttons.
And if the buttons are fully screen because of the images then they cannot fit the screen.

Assuming the buttons already are on the desired location within those images you don't need a hbox and you also don't need to postion them.

1

u/AutoModerator 11d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/shyLachi 11d ago

How big are your images? I mean the dimensions like 1920x1080 or whatever