Keeping current scene when using jump command [Solved]

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
Strum
Veteran
Posts: 215
Joined: Mon Sep 28, 2009 10:38 am
Contact:

Keeping current scene when using jump command [Solved]

#1 Post by Strum »

Hi, sorry but I got another question. Is there a way to keep the current background when jumping to another part of the program by jumping to another label. Take a look at the attachments to see what I mean. I want to call up a menu screen while retaining the current scene as the background. But ren'py will always delete the current image when it moves on to the next lable via the jump command.
Attachments
This is the actual result of what happens when I call menu.
This is the actual result of what happens when I call menu.
This is the effect I'm aiming for.
This is the effect I'm aiming for.
This is the current scene in game before calling up menu.
This is the current scene in game before calling up menu.
Last edited by Strum on Sat Oct 03, 2009 10:02 am, edited 1 time in total.
Image

Melkoshi
Regular
Posts: 156
Joined: Tue Jun 02, 2009 8:56 pm
Projects: Jewels of Sytinane
Location: U.s.a.
Contact:

Re: Keeping current scene when using jump command

#2 Post by Melkoshi »

sounds like you might wanna use the callsinnewcontext inside of jump. that'll bring the menu up over the current gameplay.

http://renpy.org/wiki/renpy/doc/referen ... newcontext

edit: also make sure that the images are transparent else they will show up the same as in your current result!!
--- My DeviantArt.
Game in Progress for demo-teaser:
story(script) = 45%
sprites = 100%
programming(interface) = 35%
CGs = 0%
Backgrounds = 5%
Music/sound = 0%

Strum
Veteran
Posts: 215
Joined: Mon Sep 28, 2009 10:38 am
Contact:

Re: Keeping current scene when using jump command

#3 Post by Strum »

Thank you very much, that's just the function I've been looking for. Another lesson learned, well time for me to plod on with the game.
Image

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Keeping current scene when using jump command

#4 Post by JinzouTamashii »

I've been trying all morning to make a frame like you've already got enabled on your bottom screenshot ... (’-’*) Did you use imagemaps or place the buttons differently?

Is there a premade frame with buttons on the Wiki already? I don't need graphics (I can make those), just a general idea of the code.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Strum
Veteran
Posts: 215
Joined: Mon Sep 28, 2009 10:38 am
Contact:

Re: Keeping current scene when using jump command

#5 Post by Strum »

I just used a code posted by PyTom to make those in game buttons

Code: Select all

# This file adds a number of buttons to the lower-right hand corner of
# the screen. Three of these buttons jump to the game menu, which
# giving quick access to Load, Save, and Prefs. The fourth button
# toggles skipping, to make that more convenient.

init:

    # Give us some space on the right side of the screen.
    $ style.window.right_margin = 100

    python:

        def toggle_skipping():
            config.skipping = not config.skipping

        def button_game_menu():

            # to save typing
            ccinc = renpy.curried_call_in_new_context

            ui.vbox(xpos=0.98, ypos=0.98, xanchor='right', yanchor='bottom')
            ui.textbutton("Skip", clicked=toggle_skipping)
            ui.textbutton("Save", clicked=ccinc("_game_menu_save"))
            ui.textbutton("Load", clicked=ccinc("_game_menu_load"))
            ui.textbutton("Prefs", clicked=ccinc("_game_menu_preferences"))
            ui.close()


        config.overlay_functions.append(button_game_menu)
You just need to change the textbuttons to imagebuttons.
Image

tigerkidde
Regular
Posts: 155
Joined: Sun Mar 01, 2009 2:31 pm
Projects: Summer Tales of Katt and June
Contact:

Re: Keeping current scene when using jump command

#6 Post by tigerkidde »

Gotta remember this thread. Easier if I post for future reference. Thanks!

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Keeping current scene when using jump command [Solved]

#7 Post by JinzouTamashii »

I'll just use this thread instead of making a new one: what's the appropriate method of turning

Code: Select all

 ui.textbutton("Skip", clicked=toggle_skipping)
into an imagebutton within the game menu on the textbox?

I found this: http://www.renpy.org/wiki/renpy/doc/ref ... magebutton but I'm not sure how to embed that with the ui.interact function too ...
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Strum
Veteran
Posts: 215
Joined: Mon Sep 28, 2009 10:38 am
Contact:

Re: Keeping current scene when using jump command [Solved]

#8 Post by Strum »

JinzouTamashii wrote:I'll just use this thread instead of making a new one: what's the appropriate method of turning

Code: Select all

 ui.textbutton("Skip", clicked=toggle_skipping)
into an imagebutton within the game menu on the textbox?

I found this: http://www.renpy.org/wiki/renpy/doc/ref ... magebutton but I'm not sure how to embed that with the ui.interact function too ...
Don't know if you still need this since you posted 2 days ago, but try...

Code: Select all

ui.imagebutton("skipA.png", "skip.png", clicked=toggle_skipping)
Image

JinzouTamashii
Eileen-Class Veteran
Posts: 1686
Joined: Mon Sep 21, 2009 8:03 pm
Projects: E-mail me if you wanna rock the planet
Location: USA
Contact:

Re: Keeping current scene when using jump command [Solved]

#9 Post by JinzouTamashii »

Yeah, I actually bookmarked this thread... thanks, I'll try that out when I make a skipbutton.png.
Don't worry, we can get through it together. I didn't forget about you! I just got overwhelmed.
https://cherylitou.wordpress.com

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]