Page 1 of 1

[SOLVED] images for imagebutton not showing up?

Posted: Thu Oct 01, 2020 12:56 am
by yeikias
Hello. This is my first time using Ren'py and I am pretty much a beginner at python too.

I'm trying to put arrow buttons on the top left and top right of the screen, but for some reason they are not showing up?

Code: Select all

screen doorview():
    modal True
    add "doorview.png"
    imagebutton:
        xalign 0.0
        yalign 0.0
        idle "rightarrow.png" at topright
        action Call ("windowview")

    imagebutton:
        xalign 0.0
        yalign 0.0
        idle "leftarrow.png" at topleft

    imagemap:
        ground "doorview.png"
        hotspot(746, 177, 287, 174) action Call ("desk_view")
        
As of right now, I do not have an action for the left button, but the right button should be there and when clicked, it should take you to another screen. So right now, if you click the right, it actually takes you to the other screen but the actual arrows are not showing up.

This is what the screen looks like currently. I'm just playing around with it so I drew something up real quick so please don't mind the drawing lmao.
Screen Shot 2020-09-30 at 11.45.51 PM.png
Basically, there should be a left arrow on the top left, and a right arrow on the top right. What am I doing wrong?

Re: images for imagebutton not showing up?

Posted: Thu Oct 01, 2020 12:20 pm
by RicharDann
I think the imagemap is being drawn over the buttons, because you placed it on the screen after the imagebutton declaration. Ren'py draws screen elements in the same order you code them, so in this case, the imagebuttons are drawn and placed on the game screen first, then the imagemap is drawn, but since it covers the whole screen, the buttons aren't visible.

So you need to swap their position in the code for the buttons to show up over the imagemap.

Re: images for imagebutton not showing up?

Posted: Thu Oct 01, 2020 2:02 pm
by yeikias
RicharDann wrote: Thu Oct 01, 2020 12:20 pm I think the imagemap is being drawn over the buttons, because you placed it on the screen after the imagebutton declaration. Ren'py draws screen elements in the same order you code them, so in this case, the imagebuttons are drawn and placed on the game screen first, then the imagemap is drawn, but since it covers the whole screen, the buttons aren't visible.

So you need to swap their position in the code for the buttons to show up over the imagemap.

That did it!! Thank you!!