Ren'py: Need help with imagebuttons

Niteowl

Member
Game Developer
Apr 6, 2018
296
370
Hi guys,

You've been very helpful so far, in my quest to learn how to code in Ren'py.... I feel like I've learned a lot, and been working on a rather complex game mostly with no problem (and I got valuable help here when I had issues).

So... so far I haven't really needed to make clickable areas on the screen, but now I want to add a shop...... and I figure imagebuttons would be a good way to go about it..

I understand I would need three images for each item (idle hovered and locked, after the item is purchased)....
but I've looked at many tutorials and the documentation and I find it all rather confusing. I'm okay with adding screens, setting the position etc, I just can't find simple. clear examples of how to properly create an imagebutton...
Do you guys have any sample code I could look at? Or any advice? Or a link to a tutorial that actually explains it in detail instead of just mentioning a few random things that make no sense?

to be more specific:
I think I have to define the three images (hover etc)
and add an action for each button (jump to an area with dialogues for buying the item)
and somehow have ren'py recognize the item should be locked after it's purchased....
any sample of how to do that? (especially the part related to the image button, the rest I should be able to do already) Any thoughts?