[SOLVED] images for imagebutton not showing up?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
yeikias
Newbie
Posts: 3
Joined: Thu Oct 01, 2020 12:43 am
Contact:

[SOLVED] images for imagebutton not showing up?

#1 Post 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?
Last edited by yeikias on Thu Oct 01, 2020 9:26 pm, edited 1 time in total.

User avatar
RicharDann
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: images for imagebutton not showing up?

#2 Post 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.
The most important step is always the next one.

yeikias
Newbie
Posts: 3
Joined: Thu Oct 01, 2020 12:43 am
Contact:

Re: images for imagebutton not showing up?

#3 Post 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!!

Post Reply

Who is online

Users browsing this forum: Andredron, Majestic-12 [Bot]