Ren'Py Imagebutton help needed.

Rappax

Newbie
Mar 19, 2018
24
2
Hey guys. I´ve ran into some problems. I want to add some image buttons into my renpy game and it activates only one of them, I mean that the hover parameter gets triggered whenever the mouse is in the window of the game. How can i make the image get triggered only in the place where the hover image is located ?

Code :
screen basemap_navi:
add "basemap.png"
imagebutton:
focus_mask True
idle "basemap.png"
hover "basetoliving.png"

action Jump("livmorning")

imagebutton:
focus_mask True
idle "basemap.png"
hover "basetokitchen.png"

action Jump("kitchmorn")

imagebutton:
focus_mask True
idle "basemap.png"
hover "basetorooms.png"

action Jump("rooms")

Thanks
 

Epadder

Programmer
Game Developer
Oct 25, 2016
567
1,047
Don't use the "basemap.png" as the idle for your buttons, that basically means that the whole map is a button. You need a separate image to use for those buttons.

That's the problem that immediately jumps out at me... you could have problems with your hover images too, but I don't know unless you show them. :unsure:
 

Rich

Old Fart
Modder
Respected User
Donor
Game Developer
Jun 25, 2017
2,452
6,908
Also, when you post Ren'py code, indentation is really important, so mark it as code. There's an editor option to do this - the three horizontal dots just to the right of the smiley.
 

Rappax

Newbie
Mar 19, 2018
24
2
Code:
screen basemap_navi:
        add "basemap.png"
        imagebutton:
            focus_mask True
            idle "basemap.png"
            hover "basetoliving.png"

            action Jump("livmorning")

        imagebutton:
            focus_mask True
            idle "basemap.png"
            hover "basetokitchen.png"
            
            action Jump("kitchmorn")

        imagebutton:
            focus_mask True
            idle "basemap.png"
            hover "basetorooms.png"

            action Jump("rooms")



    label basemap:
        call screen basemap_navi
The hovers are really basic. I tried only the yellow semi see through color, and it didn´t work either.
 

Epadder

Programmer
Game Developer
Oct 25, 2016
567
1,047
Okay here is the code and images showing my point, you can replicate this concept for the rest of your maps ;)

Python:
screen basemap_navi():
    modal True
    add "basemap.png"
    imagebutton:
        focus_mask True
        idle "basetoliving.png"
        hover "hovertoliving.png"

        action Jump("livmorning")

    imagebutton:
        focus_mask True
        idle "basetokitchen.png"
        hover "hovertokitchen.png"
       
        action Jump("kitchmorn")

    imagebutton:
        focus_mask True
        idle "basetorooms.png"
        hover "hovertorooms.png"

        action Jump("rooms")
 
  • Like
Reactions: Rappax

Rappax

Newbie
Mar 19, 2018
24
2
Okay here is the code and images showing my point, you can replicate this concept for the rest of your maps ;)

Python:
screen basemap_navi():
    modal True
    add "basemap.png"
    imagebutton:
        focus_mask True
        idle "basetoliving.png"
        hover "hovertoliving.png"

        action Jump("livmorning")

    imagebutton:
        focus_mask True
        idle "basetokitchen.png"
        hover "hovertokitchen.png"
      
        action Jump("kitchmorn")

    imagebutton:
        focus_mask True
        idle "basetorooms.png"
        hover "hovertorooms.png"

        action Jump("rooms")
Legend. Thank you very much.