Can't show images over screens?

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
Rhythm
Newbie
Posts: 9
Joined: Wed Feb 22, 2017 10:29 am
Contact:

Can't show images over screens?

#1 Post by Rhythm » Thu Aug 31, 2017 8:39 am

I've got screens defined for all my areas so I can use imagebuttons, e.g.

Code: Select all

screen lounge:
    add "images/areas/lounge.png"
    imagebutton auto "images/buttons/bathroombutton_%s.png" xpos 925 action Jump("bathroom") focus_mask True
    imagebutton auto "images/buttons/loungebutton_%s.png" xpos 1100 action Jump("lounge") focus_mask True
    imagebutton auto "images/buttons/mbedroombutton_%s.png" xpos 1275 action Jump("mbedroom") focus_mask True
    imagebutton auto "images/buttons/abedroombutton_%s.png" xpos 1450 action Jump("abedroom") focus_mask True
    imagebutton auto "images/buttons/sbedroombutton_%s.png" xpos 1625 action Jump("sbedroom") focus_mask True
but as soon as I try to add any images over it in my script, they don't show up? e.g.

Code: Select all

call screen lounge
show dog

What am I doing wrong? D:

User avatar
DannyGMaster
Regular
Posts: 113
Joined: Fri Sep 02, 2016 11:07 am
Contact:

Re: Can't show images over screens?

#2 Post by DannyGMaster » Thu Aug 31, 2017 9:36 am

When you use call screen, the game stops at that line, shows whatever the screen has and doesn't go to the next line until the screen you called finishes executing. The only way of exiting the screen in your case is jumping to another label using your imagebuttons, and when you do that the show dog line following is never executed, nor any line you write after it, since you 'jumped' to a different part of the script.

So if you want the images to appear you would have to show them first, then call the screen. If you still need to do it the other way around, there could be ways but it would likely require a little extra work.
Last edited by DannyGMaster on Thu Aug 31, 2017 9:42 am, edited 1 time in total.
The silent voice within one's heart whispers the most profound wisdom.

Rhythm
Newbie
Posts: 9
Joined: Wed Feb 22, 2017 10:29 am
Contact:

Re: Can't show images over screens?

#3 Post by Rhythm » Thu Aug 31, 2017 9:41 am

Ok thanks, that works for my events.

My specific issue I guess was that I was trying to follow one of the clock tutorials and have it overlaid on the screen on all screens, but all of the tutorials have the clocks being called as another screen or multiple images, which I can't get to show and I can't seem to find any guides for incorporating the clock into all screens by default. Any clue on that?

User avatar
DannyGMaster
Regular
Posts: 113
Joined: Fri Sep 02, 2016 11:07 am
Contact:

Re: Can't show images over screens?

#4 Post by DannyGMaster » Thu Aug 31, 2017 10:18 am

Rhythm wrote:
Thu Aug 31, 2017 9:41 am
Ok thanks, that works for my events.

My specific issue I guess was that I was trying to follow one of the clock tutorials and have it overlaid on the screen on all screens, but all of the tutorials have the clocks being called as another screen or multiple images, which I can't get to show and I can't seem to find any guides for incorporating the clock into all screens by default. Any clue on that?
Well, you could manually add the clock to every single screen you want to use it on in your game. At the beginning of the screen you could put an use statement if the clock is a screen:

Code: Select all

screen lounge():
    use clock_screen()
Or, if it's an image:

Code: Select all

screen lounge():
    add clock

That way you can have it shown whenever the screen appears.
The silent voice within one's heart whispers the most profound wisdom.

Rhythm
Newbie
Posts: 9
Joined: Wed Feb 22, 2017 10:29 am
Contact:

Re: Can't show images over screens?

#5 Post by Rhythm » Thu Aug 31, 2017 10:26 am

Thanks, I'll try doing it that way

User avatar
trooper6
Lemma-Class Veteran
Posts: 3645
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Can't show images over screens?

#6 Post by trooper6 » Thu Aug 31, 2017 11:47 am

Keep the clock on one screen, but use zorder values to make sure the clock screen is in front of other screens.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

Post Reply

Who is online

Users browsing this forum: badanni, Bing [Bot], Google [Bot]