[SOLVED] Can I open one specific screen multiple at the same time?

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
wtfman
Regular
Posts: 37
Joined: Sat Mar 30, 2013 7:26 pm
Contact:

[SOLVED] Can I open one specific screen multiple at the same time?

#1 Post by wtfman »

notepads.png
For example, I made a screen named 'sigle_window' and made a button to open the screen 'single_window'

I want to open the same 'single_window' screen multiple when pressing a button, like a regular GUI OS(see the attachment image if you don't understand. Sorry)

Is It possible to make?


PS: And can I change the screen's zorder when clicking or activating the screen? Also like windows or regular GUI OS
Last edited by wtfman on Tue Sep 20, 2022 12:44 pm, edited 1 time in total.

enaielei
Veteran
Posts: 293
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Can I open one specific screen multiple at the same time?

#2 Post by enaielei »

https://www.renpy.org/doc/html/screen_actions.html#Show wrote: This action takes the _layer, _zorder and _tag keyword arguments, which have the same meaning as in the renpy.show_screen() function.
Different _tag on each Show allows you to show multiple instances of the screen.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2434
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Can I open one specific screen multiple at the same time?

#3 Post by Ocelot »

1) Yes. renpy.show_screen( 'single_window', tag="some_other_name"). The only requirements are that tags should be unique and you need to keep track of tags used.

2) Yes. Probably works best if you simply reshow window with diffrent zorder.
< < insert Rick Cook quote here > >

wtfman
Regular
Posts: 37
Joined: Sat Mar 30, 2013 7:26 pm
Contact:

Re: Can I open one specific screen multiple at the same time?

#4 Post by wtfman »

Ocelot wrote: Tue Sep 20, 2022 4:22 am 1) Yes. renpy.show_screen( 'single_window', tag="some_other_name"). The only requirements are that tags should be unique and you need to keep track of tags used.

2) Yes. Probably works best if you simply reshow window with diffrent zorder.
But when reloading the screen, coordination is reset and always appears in the left top corner of the screen(screen is draggable). Can find or extract the current screen's coordinates?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2434
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Can I open one specific screen multiple at the same time?

#5 Post by Ocelot »

If they are implemented as Drag Displayables, then coordinates are avaliable as x andy members of corresponding Drag pbject.

Another way to show screen multiple times is to use it multiple times in parent screen. Don't know, if it would be applicable to your project.
< < insert Rick Cook quote here > >

wtfman
Regular
Posts: 37
Joined: Sat Mar 30, 2013 7:26 pm
Contact:

Re: Can I open one specific screen multiple at the same time?

#6 Post by wtfman »

Ocelot wrote: Tue Sep 20, 2022 5:57 am If they are implemented as Drag Displayables, then coordinates are avaliable as x andy members of corresponding Drag pbject.

Another way to show screen multiple times is to use it multiple times in parent screen. Don't know, if it would be applicable to your project.
Am I need to use python callback to get screen coordinates?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2434
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Can I open one specific screen multiple at the same time?

#7 Post by Ocelot »

Depending on how you will structure your screens, maybe yes, maybe screen actions will suffice, maybe a straightforwayd function call before reshowing window.
< < insert Rick Cook quote here > >

wtfman
Regular
Posts: 37
Joined: Sat Mar 30, 2013 7:26 pm
Contact:

Re: Can I open one specific screen multiple at the same time?

#8 Post by wtfman »

screenshot0097.png
screenshot0096.png
All is solved. I apply tag to open same window multiple and added drag_name in drag to remember screen's location. Like this:

Code: Select all

screen text_window(texttitle, innertext, tagname):
    drag:
        drag_handle (0, 0, 1.0, 50)
        drag_name tagname
        draggable True
        
    frame:
        textbutton "[texttitle]" xalign 0.5 action Hide(tagname), Show("text_window", texttitle="blah", innertext="blahblahblah", tagname = "mumble", _tag = "mumble")
...

screen openbutton:
    textbutton "open" action Show("text_window", texttitle="blah", innertext="blahblahblah", tagname = "mumble", _tag = "mumble")
Thank you!

Post Reply

Who is online

Users browsing this forum: kedta35