Make something appear above dialogue window (SOLVED)
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.
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.
Make something appear above dialogue window (SOLVED)
I use a slightly-complicated Digital Calendar, but when the calendar show, it appear behind the dialogue window. Anyone know how to make it move to the top first?
Last edited by bimb2212 on Thu Oct 30, 2014 11:18 pm, edited 1 time in total.
Re: Make something appear above dialogue window.
It would be better if you'd show your code to let people check what should be changed.
-
- Regular
- Posts: 42
- Joined: Sat Mar 31, 2012 2:56 pm
- Location: projectexist.net
- Contact:
Re: Make something appear above dialogue window.
I think OP may be using the Cookbook recipe.
http://www.renpy.org/wiki/renpy/doc/coo ... l_Calendar
def Calendar(): and def Clocks(): require a yalign change in their ui.frame statements.
ui.frame(xfill=False, xminimum = 110, yminimum=None, xalign=1.0, yalign = 0.76)
0.76 is worth changing.
http://www.renpy.org/wiki/renpy/doc/coo ... l_Calendar
def Calendar(): and def Clocks(): require a yalign change in their ui.frame statements.
ui.frame(xfill=False, xminimum = 110, yminimum=None, xalign=1.0, yalign = 0.76)
0.76 is worth changing.
- Milkymalk
- Miko-Class Veteran
- Posts: 760
- Joined: Wed Nov 23, 2011 5:30 pm
- Completed: Don't Look (AGS game)
- Projects: KANPEKI! ★Perfect Play★
- Organization: Crappy White Wings
- Location: Germany
- Contact:
Re: Make something appear above dialogue window.
That will change the position, but not the z-order.
The calender has to either get moved to a layer at least as high as the text box, or if it's on the same layer, be given a higher z-order.
The calender has to either get moved to a layer at least as high as the text box, or if it's on the same layer, be given a higher z-order.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
Re: Make something appear above dialogue window.
Yeah, I don't know how to change the z-order when use def statement in init python. But I use a quick fix: remove the def Calendar(), def Clock(), ui, copy and change these codes that fit screen statement, and it appear in-front. For now, I only know that the dialogue box appears behind screen statement, but before define statement.
Re: Make something appear above dialogue window.
The zorder is used when you show separate screens or displayables, but in this recipe calendar and clock are added into the say screen. The elements of a screen appears onscreen in the order you added them in your code. So if you addedpart right at the beginning of the say screen, then your calendar appeared first and then the whole textbox over it.
Just move this lines of code to the end of say screen code (right after "use quick_menu" line) to make calendar and clock appear on top of your textbox.
Code: Select all
if(clock):
$ Calendar()
$ Clocks()
Just move this lines of code to the end of say screen code (right after "use quick_menu" line) to make calendar and clock appear on top of your textbox.
Re: Make something appear above dialogue window.
I moved them to end of say screen, and even move to quick menu screen, still the same problem. I think, for default, every def statement that called in screen, will appear behind the say box.Alex wrote:The zorder is used when you show separate screens or displayables, but in this recipe calendar and clock are added into the say screen. The elements of a screen appears onscreen in the order you added them in your code. So if you addedpart right at the beginning of the say screen, then your calendar appeared first and then the whole textbox over it.Code: Select all
if(clock): $ Calendar() $ Clocks()
Just move this lines of code to the end of say screen code (right after "use quick_menu" line) to make calendar and clock appear on top of your textbox.
Re: Make something appear above dialogue window.
Hm, it worked for me...
Show your code for say screen then (or upload the project to let people test it).
Show your code for say screen then (or upload the project to let people test it).
Re: Make something appear above dialogue window.
Sorry for slow reply, this is my say screen:Alex wrote:Hm, it worked for me...
Show your code for say screen then (or upload the project to let people test it).
Code: Select all
screen say:
default side_image = None
window:
id "window"
has vbox:
style "say_vbox"
if who:
text who id "who"
text what id "what"
# If there's a side image, display it above the text.
if side_image:
add side_image
else:
add SideImage() xalign 0.0 yalign 1.0
key "K_F1" action ShowMenu('help')
key "K_F5" action QuickSave()
key "K_F9" action QuickLoad()
key "K_a" action [Preference("auto-forward", "toggle"), Play("sound", "sound/sfx/click.wav")]
if show_game_hud0:
use game_hud0
if show_game_hud1:
use game_hud1
if show_game_hud2:
use game_hud2
if show_game_hud3:
use game_hud3
if show_game_hud4:
use game_hud4
init -2 python:
show_game_hud0=False
show_game_hud1=True
show_game_hud2=False
show_game_hud3=False
show_game_hud4=False
Re: Make something appear above dialogue window.
So, how do you show the calendar and clock then?
I was expecting to see something like:
I was expecting to see something like:
Code: Select all
screen say:
default side_image = None
window:
id "window"
has vbox:
style "say_vbox"
if who:
text who id "who"
text what id "what"
# If there's a side image, display it above the text.
if side_image:
add side_image
else:
add SideImage() xalign 0.0 yalign 1.0
key "K_F1" action ShowMenu('help')
key "K_F5" action QuickSave()
key "K_F9" action QuickLoad()
key "K_a" action [Preference("auto-forward", "toggle"), Play("sound", "sound/sfx/click.wav")]
if show_game_hud0:
use game_hud0
if show_game_hud1:
use game_hud1
if show_game_hud2:
use game_hud2
if show_game_hud3:
use game_hud3
if show_game_hud4:
use game_hud4
if(clock):
$ Calendar()
$ Clocks()
Re: Make something appear above dialogue window.
Ya, I place it at there, still appears behind the say box. Even I created fresh new renpy game, copy and paste code, the same resultAlex wrote:So, how do you show the calendar and clock then?
I was expecting to see something like:
Re: Make something appear above dialogue window.
Well, interesting...
Could you attach the rpy-files of that fresh project to let me see this behaviour?
Could you attach the rpy-files of that fresh project to let me see this behaviour?
Re: Make something appear above dialogue window.
I mean that I press "create new project" in Ren'py, without touch anything about Eileen's welcome, then I paste the digital calendar code... I use lastest version of ren'py.
Re: Make something appear above dialogue window.
Well, ok - this code worked in Ren'Py 6.16, but in 6.18 something has changed about using the layers. So for now you ought to specify the 'screens' layer as the layer to show your calendar and clock:This will make it work again.
Code: Select all
def Calendar():
ui.layer('screens') # <======= add this
ui.frame(xfill=False, xminimum = 400, yminimum=None, xalign=1.0, yalign = 0.805)
ui.vbox()
ui.text("(%s) - %s %d %d" % (stringweekday, stringmonth, theday, theyear), xalign=1.0, size=20)
ui.close()
ui.close() # <======= and this
def Clocks():
ui.layer('screens') # <======= add this
ui.frame(xfill=False, xminimum = 110, yminimum=None, xalign=1.0, yalign = 0.76)
ui.vbox()
if (minutes > 719):
if ((minutes - (int(minutes/60))*60) < 10):
if((int(minutes/60)) == 12):
ui.text("12:0%d PM" % ((minutes - (int(minutes/60))*60)), xalign=1.0, size=20)
else:
ui.text("%d:0%d PM" % ((int(minutes/60)-12), (minutes - (int(minutes/60))*60)), xalign=1.0, size=20)
else:
if((int(minutes/60)) == 12):
ui.text("12:%d PM" % ((minutes - (int(minutes/60))*60)), xalign=1.0, size=20)
else:
ui.text("%d:%d PM" % ((int(minutes/60)-12), (minutes - (int(minutes/60))*60)), xalign=1.0, size=20)
else:
if ((minutes - (int(minutes/60))*60) < 10):
if((int(minutes/60)) == 0):
ui.text("12:0%d AM" % ((minutes - (int(minutes/60))*60)), xalign=1.0, size=20)
else:
ui.text("%d:0%d AM" % ((int(minutes/60)), (minutes - (int(minutes/60))*60)), xalign=1.0, size=20)
else:
if((int(minutes/60)) == 0):
ui.text("12:%d AM" % ((minutes - (int(minutes/60))*60)), xalign=1.0, size=20)
else:
ui.text("%d:%d AM" % ((int(minutes/60)), (minutes - (int(minutes/60))*60)), xalign=1.0, size=20)
ui.close()
ui.close() # <======= and this
Re: Make something appear above dialogue window.
Woa, so if every def statement that I call with a frame in it, I need to specify the 'screens' layer to make it appear in front of the say screen. Thanks for your help!
Who is online
Users browsing this forum: Google [Bot]