Page 1 of 1

Can't show images over screens?

Posted: Thu Aug 31, 2017 8:39 am
by Rhythm
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:

Re: Can't show images over screens?

Posted: Thu Aug 31, 2017 9:36 am
by DannyGMaster
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.

Re: Can't show images over screens?

Posted: Thu Aug 31, 2017 9:41 am
by Rhythm
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?

Re: Can't show images over screens?

Posted: Thu Aug 31, 2017 10:18 am
by DannyGMaster
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.

Re: Can't show images over screens?

Posted: Thu Aug 31, 2017 10:26 am
by Rhythm
Thanks, I'll try doing it that way

Re: Can't show images over screens?

Posted: Thu Aug 31, 2017 11:47 am
by trooper6
Keep the clock on one screen, but use zorder values to make sure the clock screen is in front of other screens.