-
Notifications
You must be signed in to change notification settings - Fork 0
/
screens.rpy
1805 lines (1456 loc) · 74.6 KB
/
screens.rpy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#########################################
#
# This file is in the public domain. Feel free to modify it and use it anyway you want.
#
#########################################
################################################################################
## Styles
################################################################################
style default:
properties gui.text_properties()
language gui.language
style input:
properties gui.text_properties("input", accent=True)
adjust_spacing False
style hyperlink_text:
properties gui.text_properties("hyperlink", accent=True)
hover_underline True
style gui_text:
properties gui.text_properties("interface")
style button:
properties gui.button_properties("button")
style button_text is gui_text:
properties gui.text_properties("button")
yalign 0.5
style label_text is gui_text:
properties gui.text_properties("label", accent=True)
style prompt_text is gui_text:
properties gui.text_properties("prompt")
style bar:
ysize gui.bar_size
left_bar Frame("gui/bar/left.png", gui.bar_borders, tile=gui.bar_tile)
right_bar Frame("gui/bar/right.png", gui.bar_borders, tile=gui.bar_tile)
style vbar:
xsize gui.bar_size
top_bar Frame("gui/bar/top.png", gui.vbar_borders, tile=gui.bar_tile)
bottom_bar Frame("gui/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile)
style scrollbar:
ysize gui.scrollbar_size
base_bar Frame("gui/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
thumb Frame("gui/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
style vscrollbar:
xsize gui.scrollbar_size
base_bar Frame("gui/scrollbar/vertical_[prefix_]bar.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
thumb Frame("gui/scrollbar/vertical_[prefix_]thumb.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
style slider:
ysize gui.slider_size
base_bar Frame("gui/slider/horizontal_[prefix_]bar.png", gui.slider_borders, tile=gui.slider_tile)
thumb "gui/slider/horizontal_[prefix_]thumb.png"
style vslider:
xsize gui.slider_size
base_bar Frame("gui/slider/vertical_[prefix_]bar.png", gui.vslider_borders, tile=gui.slider_tile)
thumb "gui/slider/vertical_[prefix_]thumb.png"
style frame:
padding gui.frame_borders.padding
background Frame("gui/frame.png", gui.frame_borders, tile=gui.frame_tile)
init:
transform trans30:
alpha 0.3
image main_menu_cg="gui/test_background.jpg"
image main_menu_cg_foggy=LiveComposite((1280,720), (0,0), Solid("#fff"), (0,0), At("gui/test_background.jpg", trans30))
## ■██▓▒░ MAIN MENU ░▒▓█████████████████████████████████████■
## Screen that's used to display the main menu, when Ren'Py first starts
## http://www.renpy.org/doc/html/screen_special.html#main-menu
screen main_menu:
tag menu # This ensures that any other menu screen is replaced.
# Add a background image for the main menu:
add "main_menu_cg"
add "gui/main_menu_ground.png"
add "gui/main_menu_title.png"
$ x = 995
$ y=110
imagebutton auto "gui/MainStart-%s.png" xpos x ypos y focus_mask None action Start() hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_main_menu_start") ] unhovered [Hide("gui_tooltip")] at main_eff1
$ y+=90
imagebutton auto "gui/MainLoadStart-%s.png" xpos x ypos y focus_mask None action ShowMenu('load') hovered [ Play ("test_two", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_load") ] unhovered [Hide("gui_tooltip")] at main_eff2
$ y+=90
imagebutton auto "gui/MainOptionsStart-%s.png" xpos x ypos y focus_mask None action ShowMenu('preferences') hovered [ Play ("test_three", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_config") ] unhovered [Hide("gui_tooltip")] at main_eff3
$ y+=90
# if persistent.extra_unlocked: # We only show the extras, if they have been unlocked. Because we are using a variable (y) for ypos, we don't need to worry about positioning the rest of the button(s).
imagebutton auto "gui/MainExtrasStart-%s.png" xpos x ypos y focus_mask None action ShowMenu('extras_blank') hovered [ Play ("test_four", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_main_menu_extras") ] unhovered [Hide("gui_tooltip")] at main_eff4
$ y+=90
imagebutton auto "gui/MainHelpStart-%s.png" xpos x ypos y focus_mask None action ShowMenu('help') hovered [ Play ("test_five", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_main_menu_help") ] unhovered [Hide("gui_tooltip")] at main_eff4
$ y+=90
imagebutton auto "gui/MainQuitStart-%s.png" xpos x ypos y focus_mask None action Quit(confirm=False) hovered [ Play ("test_six", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_quit") ] unhovered [Hide("gui_tooltip")] at main_eff5
# The code below defines the ATL transform effects for each button on the main menu. These effects are triggered when the buttons are shown.
# ATL transform properties: http://www.renpy.org/wiki/renpy/doc/reference/Animation_and_Transformation_Language#Transform_Properties
init -2:
transform main_eff1:
zoom 0.5
easein 0.4 zoom 1.0
transform main_eff2:
zoom 0.5
easein 0.8 zoom 1.0
transform main_eff3:
zoom 0.5
easein 1.2 zoom 1.0
transform main_eff4:
zoom 0.5
easein 1.6 zoom 1.0
transform main_eff5:
zoom 0.5
easein 2.0 zoom 1.0
transform main_eff6:
zoom 0.5
easein 2.4 zoom 1.0
style main_menu_frame is empty
style main_menu_vbox is vbox
style main_menu_text is gui_text
style main_menu_title is main_menu_text
style main_menu_version is main_menu_text
## Input screen ################################################################
##
## This screen is used to display renpy.input. The prompt parameter is used to
## pass a text prompt in.
##
## This screen must create an input displayable with id "input" to accept the
## various input parameters.
##
## https://www.renpy.org/doc/html/screen_special.html#input
screen input(prompt):
style_prefix "input"
window:
vbox:
xalign gui.dialogue_text_xalign
xpos gui.dialogue_xpos
xsize gui.dialogue_width
ypos gui.dialogue_ypos
text prompt style "input_prompt"
input id "input"
style input_prompt is default
style input_prompt:
xalign gui.dialogue_text_xalign
properties gui.text_properties("input_prompt")
style input:
xalign gui.dialogue_text_xalign
xmaximum gui.dialogue_width
## ■██▓▒░ NAVIGATION ░▒▓████████████████████████████████████■
## This screen is responsible for the game menu/navigation. It's included in other screens to display the game menu navigation.
## http://www.renpy.org/doc/html/screen_special.html#navigation
screen navigation:
add "main_menu_cg_foggy"
add "gui/main_menu_ground.png"
add "gui/game_menu_ground.png"
imagebutton:
background "gui/OptionsSaveGame-insensitive.png"
idle "gui/OptionsSaveGame-idle.png"
hover "gui/OptionsSaveGame-hover.png"
selected_idle "gui/OptionsSaveGame-selected_idle.png"
selected_hover "gui/OptionsSaveGame-selected_hover.png"
xpos 980
ypos 129
focus_mask True
action ShowMenu('save')
hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_save") ]
unhovered [Hide("gui_tooltip")] at nav_eff
imagebutton:
background "gui/OptionsLoadGame-insensitive.png"
idle "gui/OptionsLoadGame-idle.png"
hover "gui/OptionsLoadGame-hover.png"
selected_idle "gui/OptionsLoadGame-selected_idle.png"
selected_hover "gui/OptionsLoadGame-selected_hover.png"
xpos 980
ypos 214
focus_mask True
action ShowMenu('load')
hovered [ Play ("test_two", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_load") ]
unhovered [Hide("gui_tooltip")] at nav_eff
imagebutton:
background "gui/OptionsOptions-insensitive.png"
idle "gui/OptionsOptions-idle.png"
hover "gui/OptionsOptions-hover.png"
selected_idle "gui/OptionsOptions-selected_idle.png"
selected_hover "gui/OptionsOptions-selected_hover.png"
xpos 980
ypos 297
focus_mask True
action ShowMenu('preferences')
hovered [ Play ("test_three", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_config") ]
unhovered [Hide("gui_tooltip")] at nav_eff
# imagebutton:
# background "gui/OptionsMainMenu-insensitive.png"
# idle "gui/OptionsMainMenu-idle.png"
# hover "gui/OptionsMainMenu-hover.png"
# selected_idle "gui/OptionsMainMenu-selected_idle.png"
# selected_hover "gui/OptionsMainMenu-selected_hover.png"
# xpos 980
# ypos 381
# focus_mask True
# action MainMenu()
# hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_main") ]
# unhovered [Hide("gui_tooltip")] at nav_eff
imagebutton:
background "gui/OptionsReturn-insensitive.png"
idle "gui/OptionsReturn-idle.png"
hover "gui/OptionsReturn-hover.png"
selected_idle "gui/OptionsReturn-selected_idle.png"
selected_hover "gui/OptionsReturn-selected_hover.png"
xpos 980
ypos 465
focus_mask True
action Return()
hovered [ Play ("test_two", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_return") ]
unhovered [Hide("gui_tooltip")] at nav_eff
imagebutton:
background "gui/OptionsQuitGame-insensitive.png"
idle "gui/OptionsQuitGame-idle.png"
hover "gui/OptionsQuitGame-hover.png"
selected_idle "gui/OptionsQuitGame-selected_idle.png"
selected_hover "gui/OptionsQuitGame-selected_hover.png"
xpos 980
ypos 549
focus_mask True
action Quit()
hovered [ Play ("test_three", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_quit") ]
unhovered [Hide("gui_tooltip")] at nav_eff
imagebutton auto "gui/game_menu_main_menu_%s.png" xpos 980 ypos 381 focus_mask True action MainMenu() hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_game_menu_main") ] unhovered [Hide("gui_tooltip")] at nav_eff
# The code below defines the ATL transform effects for the buttons on the game menu. These effects are triggered when we hover the mouse over them (hover and selected_hover). Effects that are triggered by idle and selected_idle events (when we stop hovering the mouse over them) ensure that the buttons are moved back to the initial state.
init -2:
transform nav_eff:
on idle:
easein 0.5 xpos 980
on selected_idle:
easein 0.5 xpos 980
on hover:
easein 0.3 xpos 1000
easein 0.3 xpos 960
on selected_hover:
easein 0.3 xpos 1000
easein 0.3 xpos 960
## ■██▓▒░ PREFERENCES ░▒▓███████████████████████████████████■
## Screen that allows the user to change the preferences.
## http://www.renpy.org/doc/html/screen_special.html#prefereces
screen preferences:
tag menu # This ensures that any other menu screen is replaced.
use navigation # We include the navigation screen (game menu)
add "gui/config_ground.png" # We add the image that is shown in the background of the preferences screen.
# Display windowed/full screen:
imagebutton auto "gui/config_display_window_%s.png" xpos 405 ypos 210 focus_mask True action Preference('display', 'window') at config_eff hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_config_windowed") ] unhovered [Hide("gui_tooltip")]
imagebutton auto "gui/config_display_fullscreen_%s.png" xpos 525 ypos 210 focus_mask True action Preference('display', 'fullscreen') at config_eff hovered [ Play ("test_two", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_config_fullscreen") ] unhovered [Hide("gui_tooltip")]
# Transitions on/off:
imagebutton auto "gui/config_transitions_none_%s.png" xpos 690 ypos 210 focus_mask True action Preference('transitions', 'none') at config_eff hovered [ Play ("test_four", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_config_enable_transition") ] unhovered [Hide("gui_tooltip")]
imagebutton auto "gui/config_transitions_all_%s.png" xpos 810 ypos 210 focus_mask True action Preference('transitions', 'all') at config_eff hovered [ Play ("test_four", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_config_enable_transition") ] unhovered [Hide("gui_tooltip")]
# Stop/continue skipping after choices
imagebutton auto "gui/config_afterchoices_stop_%s.png" xpos 405 ypos 460 focus_mask True action Preference('after choices', 'stop') at config_eff hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_config_stop_skip") ] unhovered [Hide("gui_tooltip")]
imagebutton auto "gui/config_afterchoices_skip_%s.png" xpos 525 ypos 460 focus_mask True action Preference('after choices', 'skip') at config_eff hovered [ Play ("test_two", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_config_go_skip") ] unhovered [Hide("gui_tooltip")]
# Skip all/seen text
imagebutton auto "gui/config_skip_seen_%s.png" xpos 690 ypos 460 focus_mask True action Preference('skip', 'seen') at config_eff hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_config_seen") ] unhovered [Hide("gui_tooltip")]
imagebutton auto "gui/config_skip_all_%s.png" xpos 810 ypos 460 focus_mask True action Preference('skip', 'all') at config_eff hovered [ Play ("test_two", "sfx/click.wav"), Show("gui_tooltip", my_picture="tooltip_config_all") ] unhovered [Hide("gui_tooltip")]
# bar sliders for volume control, text speed and auto-forward time
frame xpos 60 ypos 228:
style_group "pref"
has vbox
bar value Preference("music volume")
frame xpos 60 ypos 350:
style_group "pref"
has vbox
bar value Preference("sound volume")
frame xpos 60 ypos 475:
style_group "pref"
has vbox
bar value Preference("text speed")
frame xpos 60 ypos 595:
style_group "pref"
has vbox
bar value Preference("auto-forward time")
init -2 python:
# Styling for the bar sliders:
# Aleema's Customizing Menus tutorial: http://lemmasoft.renai.us/forums/viewtopic.php?f=51&t=9812
# Bar style properties documentation: http://www.renpy.org/doc/html/style.html#bar-style-properties
style.pref_frame.background = None
style.pref_slider.left_bar = "gui/config_bar_full.png"
style.pref_slider.right_bar = "gui/config_bar_empty.png"
style.pref_slider.thumb = None
style.pref_slider.xmaximum = 290
style.pref_slider.ymaximum = 44
style.pref_slider.left_gutter = 0
style.pref_slider.right_gutter = 0
init -2:
transform config_eff:
on idle:
easein 0.5 rotate 0
on selected_idle:
easein 0.5 rotate 0
on hover:
easein 0.3 rotate 5
easein 0.3 rotate -5
repeat
on selected_hover:
easein 0.3 rotate 5
easein 0.3 rotate -5
repeat
python:
class TrackCursor(renpy.Displayable):
def __init__(self, child):
super(TrackCursor, self).init()
self.child = renpy.displayable(child)
self.x = None
self.y = None
def render(self, width, height, st, at):
rv = renpy.Render(width, height)
if self.x is not None:
cr = renpy.render(self.child, width, height, st, at)
cw, ch = cr.get_size()
rv.blit(cr, (self.x - cw / 2, self.y - ch / 2))
return rv
def event(self, ev, x, y, st):
if (x != self.x) or (y != self.y):
self.x = x
self.y = y
renpy.redraw(self, 0)
## ■██▓▒░ SAVE / LOAD SLOT ░▒▓██████████████████████████████■
## This represents a load/save slot. You should customize this to ensure that the placement of the thumbnail and the slot text are as desired. Positions (x1, y1, x2 and y2) are relative to the x, y parameters, that are passed when the screen is called. To set the screenshot thumbnail size see options.rpy.
init -2 python: #we initialize x and y, so the load_save_slot screen below works at startup
x=0
y=0
screen load_save_slot:
$ file_text = "% s\n %s" % (FileTime(number, empty="Empty Slot."), FileSaveName(number))
$x1=x+430
$y1=y+15
add FileScreenshot(number) xpos x1 ypos y1
$x2=x+30
$y2=y+15
text file_text xpos x2 ypos y2 size 24 outlines [(2, "05b1e6", 0, 0)]
## ■██▓▒░ SAVE SCREEN ░▒▓███████████████████████████████████■
screen save:
tag menu # This ensures that any other menu screen is replaced.
use navigation # We include the navigation/game menu screen
#add "gui/file_picker_ground.jpg" # We add the file picker background image. This image is the same for save and load screens.
add "gui/title_save.png" # We add the save title image on top of the background
use file_picker # We include the file_picker screen
## ■██▓▒░ LOAD SCREEN ░▒▓███████████████████████████████████■
screen load:
use navigation # We include the navigation/game menu screen
tag menu # This ensures that any other menu screen is replaced.
#add "gui/file_picker_ground.jpg"
add "gui/title_load.png"
use file_picker
## ■██▓▒░ SAVE / LOAD FILE PICKER ░▒▓███████████████████████■
## Since saving and loading are so similar, we combine them into a single screen, file_picker. We then use the file_picker screen from simple load and save screens.
screen file_picker:
# Buttons for selecting the save/load page:
imagebutton auto "gui/filepage1_%s.png" xpos 66 ypos 135 focus_mask True action FilePage(1) hover_sound "sfx/click.wav"
imagebutton auto "gui/filepage2_%s.png" xpos 66 ypos 310 focus_mask True action FilePage(2) hover_sound "sfx/click.wav"
imagebutton auto "gui/filepage3_%s.png" xpos 66 ypos 485 focus_mask True action FilePage(3) hover_sound "sfx/click.wav"
$ y=135 # ypos for the first save slot
for i in range(0, 3): # This repeats the block below 3 times (counts from 0 to 2), for the 3 save slots. We could also copy/paste the block below 3 times, but we are too lazy to do that.
imagebutton auto "gui/fileslot_%s.png" xpos 255 ypos y focus_mask True action FileAction(i)
use load_save_slot(number=i, x=255, y=y) # This calls the load_save_slot screen defined above. We pass variable i as the slot number and x, y coordinates.
$ y+=175 # We increase the y variable so every next save slot is moved 124px lower.
## ■██▓▒░ YES/NO PROMPT ░▒▓█████████████████████████████████■
## Screen that asks the user a yes or no question. You'll need to edit this to change the position and style of the text.
## http://www.renpy.org/doc/html/screen_special.html#yesno-prompt
screen yesno_prompt:
on "show" action Play("sound", "sfx/alert.wav")
modal True # A modal screen prevents the user from interacting with displayables below it, except for the default keymap.
add "gui/yesno_ground.png"
imagebutton auto "gui/yesno_yes_%s.png" xpos 430 ypos 450 action yes_action hover_sound "sfx/click.wav"
imagebutton auto "gui/yesno_no_%s.png" xpos 710 ypos 450 action no_action hover_sound "sfx/click.wav"
window background None xminimum 690 yminimum 380 xalign 0.5 yalign 0.5: # xmargin 340 ymargin 210:
text _(message) outlines [(2, "#0613c2", 0, 0)] color "#fff" size 30:
xalign 0.5 yalign 0.5
# if message == layout.ARE_YOU_SURE:
# add "gui/yesno_are_you_sure.png"
# elif message == layout.DELETE_SAVE:
# add "gui/yesno_delete_save.png"
# elif message == layout.OVERWRITE_SAVE:
# add "gui/yesno_overwrite_save.png"
# elif message == layout.LOADING:
# add "gui/yesno_loading.png"
# elif message == layout.QUIT:
# add "gui/yesno_quit.png"
# elif message == layout.MAIN_MENU:
# add "gui/yesno_main_menu.png"
## ■██▓▒░ CUSTOM MOUSE POINTER ░▒▓██████████████████████████■
##This block is responsible for the custom mouse pointer
# init python:
# config.mouse = { }
# config.mouse["default"] = [
# ("gui/mouse_pointer.png", 8.8, 0.0),
# ]
# Configuration variables: http://www.renpy.org/doc/html/config.html
# Custom mouse pointer is commented out, to disable it for the time being, because of an issue in all recent versions of Ren'Py.
## ■██▓▒░ TOOLTIP ░▒▓███████████████████████████████████████■
screen gui_tooltip (my_picture="", my_tt_xpos=58, my_tt_ypos=600):
add my_picture xpos my_tt_xpos ypos my_tt_ypos
## ■██▓▒░ CUSTOM SOUND CHANNEL ░▒▓██████████████████████████■
# This is the block where we declare the individual sound channels. This enables us to play several sound FX's without overlapping
init python:
renpy.music.register_channel("test_one", "sfx", False)
renpy.music.register_channel("test_two", "sfx", False)
renpy.music.register_channel("test_three", "sfx", False)
renpy.music.register_channel("test_four", "sfx", False)
renpy.music.register_channel("test_five", "sfx", False)
renpy.music.register_channel("test_six", "sfx", False)
## ■██▓▒░ THE TEXTBOX ░▒▓███████████████████████████████████■
# Screen that's used to display adv-mode dialogue.
# http://www.renpy.org/doc/html/screen_special.html#say
##############################################################################
## Say screen ##################################################################
##
## The say screen is used to display dialogue to the player. It takes two
## parameters, who and what, which are the name of the speaking character and
## the text to be displayed, respectively. (The who parameter can be None if no
## name is given.)
##
## This screen must create a text displayable with id "what", as Ren'Py uses
## this to manage text display. It can also create displayables with id "who"
## and id "window" to apply style properties.
##
## https://www.renpy.org/doc/html/screen_special.html#say
screen say(who, what):
style_prefix "say"
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
## If there's a side image, display it above the text. Do not display on the
## phone variant - there's no room.
if not renpy.variant("small"):
add SideImage() xalign 0.0 yalign 1.0
## Make the namebox available for styling through the Character object.
init python:
config.character_id_prefixes.append('namebox')
style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue
style namebox is default
style namebox_label is say_label
style window:
xalign 0.5
xfill True
yalign gui.textbox_yalign
ysize gui.textbox_height
background Image("gui/textbox.png", xalign=0.5, yalign=1.0)
style namebox:
xpos gui.name_xpos
xanchor gui.name_xalign
xsize gui.namebox_width
ypos gui.name_ypos
ysize gui.namebox_height
background Frame("gui/namebox.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
padding gui.namebox_borders.padding
style say_label:
properties gui.text_properties("name", accent=True)
xalign gui.name_xalign
yalign 0.5
style say_dialogue:
properties gui.text_properties("dialogue")
xpos gui.dialogue_xpos
xsize gui.dialogue_width
ypos gui.dialogue_ypos
## Input screen ################################################################
##
## This screen is used to display renpy.input. The prompt parameter is used to
## pass a text prompt in.
##
## This screen must create an input displayable with id "input" to accept the
## various input parameters.
##
## https://www.renpy.org/doc/html/screen_special.html#input
screen input(prompt):
style_prefix "input"
window:
vbox:
xalign gui.dialogue_text_xalign
xpos gui.dialogue_xpos
xsize gui.dialogue_width
ypos gui.dialogue_ypos
text prompt style "input_prompt"
input id "input"
style input_prompt is default
style input_prompt:
xalign gui.dialogue_text_xalign
properties gui.text_properties("input_prompt")
style input:
xalign gui.dialogue_text_xalign
xmaximum gui.dialogue_width
## Game Menu screen ############################################################
##
## This lays out the basic common structure of a game menu screen. It's called
## with the screen title, and displays the background, title, and navigation.
##
## The scroll parameter can be None, or one of "viewport" or "vpgrid". When
## this screen is intended to be used with one or more children, which are
## transcluded (placed) inside it.
style navigation_button is gui_button
style navigation_button_text is gui_button_text
style navigation_button:
size_group "navigation"
properties gui.button_properties("navigation_button")
style navigation_button_text:
properties gui.button_text_properties("navigation_button")
screen game_menu(title, scroll=None, yinitial=0.0):
style_prefix "game_menu"
if main_menu:
add gui.main_menu_background
else:
add gui.game_menu_background
frame:
style "game_menu_outer_frame"
hbox:
## Reserve space for the navigation section.
frame:
style "game_menu_navigation_frame"
frame:
style "game_menu_content_frame"
if scroll == "viewport":
viewport:
yinitial yinitial
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
vbox:
transclude
elif scroll == "vpgrid":
vpgrid:
cols 1
yinitial yinitial
scrollbars "vertical"
mousewheel True
draggable True
side_yfill True
transclude
else:
transclude
use navigation
textbutton _("Return"):
style "return_button"
action Return()
label title
if main_menu:
key "game_menu" action ShowMenu("main_menu")
style game_menu_outer_frame is empty
style game_menu_navigation_frame is empty
style game_menu_content_frame is empty
style game_menu_viewport is gui_viewport
style game_menu_side is gui_side
style game_menu_scrollbar is gui_vscrollbar
style game_menu_label is gui_label
style game_menu_label_text is gui_label_text
style return_button is navigation_button
style return_button_text is navigation_button_text
style game_menu_outer_frame:
bottom_padding 45
top_padding 180
background "gui/overlay/game_menu.png"
style game_menu_navigation_frame:
xsize 420
yfill True
style game_menu_content_frame:
left_margin 60
right_margin 30
top_margin 15
style game_menu_viewport:
xsize 1380
style game_menu_vscrollbar:
unscrollable gui.unscrollable
style game_menu_side:
spacing 15
style game_menu_label:
xpos 75
ysize 180
style game_menu_label_text:
size gui.title_text_size
color gui.accent_color
yalign 0.5
style return_button:
xpos gui.navigation_xpos
yalign 1.0
yoffset -45
## Preferences screen ##########################################################
##
## The preferences screen allows the player to configure the game to better suit
## themselves.
##
## https://www.renpy.org/doc/html/screen_special.html#preferences
screen Settings():
tag menu
use game_menu(_("Settings"), scroll="viewport"):
vbox:
hbox:
box_wrap True
if renpy.variant("pc"):
vbox:
style_prefix "radio"
label _("Display")
textbutton _("Window") action Preference("display", "window")
textbutton _("Fullscreen") action Preference("display", "fullscreen")
vbox:
style_prefix "radio"
label _("Fonts")
textbutton _("Roboto") action gui.SetPreference("font", "fonts/Roboto-Regular.ttf")
textbutton _("OpenSans") action gui.SetPreference("font", "fonts/OpenSans-Regular.ttf")
textbutton _("Corleone") action gui.SetPreference("font", "fonts/Corleone.ttf")
textbutton _("Oswald") action gui.SetPreference("font", "fonts/Oswald-Regular.ttf")
textbutton _("DancingScript") action gui.SetPreference("font", "fonts/DancingScript-Bold.ttf")
vbox:
style_prefix "check"
label _("Skip")
textbutton _("Unseen Text") action Preference("skip", "toggle")
textbutton _("After Choices") action Preference("after choices", "toggle")
textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle"))
## Additional vboxes of type "radio_pref" or "check_pref" can be
## added here, to add additional creator-defined preferences.
null height (4 * gui.pref_spacing)
hbox:
style_prefix "slider"
box_wrap True
vbox:
label _("Text Speed")
bar value Preference("text speed")
label _("Auto-Forward Time")
bar value Preference("auto-forward time")
vbox:
if config.has_music:
label _("Music Volume")
hbox:
bar value Preference("music volume")
if config.has_sound:
label _("Sound Volume")
hbox:
bar value Preference("sound volume")
if config.sample_sound:
textbutton _("Test") action Play("sound", config.sample_sound)
if config.has_music or config.has_sound or config.has_voice:
null height gui.pref_spacing
textbutton _("Mute All"):
action Preference("all mute", "toggle")
style "mute_all_button"
# init -2 python:
# renpy.register_style_preference("font", "DancingScript-Bold", style.default, "font", "fonts/DancingScript-Bold.ttf")
# renpy.register_style_preference("font", "OpenSans-Regular", style.default, "font", "fonts/OpenSans-Regular.ttf")
# renpy.register_style_preference("font", "Roboto-Regular", style.default, "font", "fonts/Roboto-Regular.ttf")
style pref_label is gui_label
style pref_label_text is gui_label_text
style pref_vbox is vbox
style radio_label is pref_label
style radio_label_text is pref_label_text
style radio_button is gui_button
style radio_button_text is gui_button_text
style radio_vbox is pref_vbox
style check_label is pref_label
style check_label_text is pref_label_text
style check_button is gui_button
style check_button_text is gui_button_text
style check_vbox is pref_vbox
style slider_label is pref_label
style slider_label_text is pref_label_text
style slider_slider is gui_slider
style slider_button is gui_button
style slider_button_text is gui_button_text
style slider_pref_vbox is pref_vbox
style mute_all_button is check_button
style mute_all_button_text is check_button_text
style pref_label:
top_margin gui.pref_spacing
bottom_margin 3
style pref_label_text:
yalign 1.0
style pref_vbox:
xsize 338
style radio_vbox:
spacing gui.pref_button_spacing
style radio_button:
properties gui.button_properties("radio_button")
foreground "gui/button/check_[prefix_]foreground.png"
style radio_button_text:
properties gui.button_text_properties("radio_button")
style check_vbox:
spacing gui.pref_button_spacing
style check_button:
properties gui.button_properties("check_button")
foreground "gui/button/check_[prefix_]foreground.png"
style check_button_text:
properties gui.button_text_properties("check_button")
style slider_slider:
xsize 525
style slider_button:
properties gui.button_properties("slider_button")
yalign 0.5
left_margin 15
style slider_button_text:
properties gui.button_text_properties("slider_button")
style slider_vbox:
xsize 675
# History screen ##############################################################
##
## This is a screen that displays the dialogue history to the player. While
## there isn't anything special about this screen, it does have to access the
## dialogue history stored in _history_list.
##
## https://www.renpy.org/doc/html/history.html
screen history():
tag menu
## Avoid predicting this screen, as it can be very large.
predict False
use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0):
style_prefix "history"
for h in _history_list:
window:
## This lays things out properly if history_height is None.
has fixed:
yfit True
if h.who:
label h.who:
style "history_name"
## Take the color of the who text from the Character, if
## set.
if "color" in h.who_args:
text_color h.who_args["color"]
$ what = renpy.filter_text_tags(h.what, allow=gui.history_allow_tags)
text what
if not _history_list:
label _("The dialogue history is empty.")
## This determines what tags are allowed to be displayed on the history screen.
define gui.history_allow_tags = set()
style history_window is empty
style history_name is gui_label
style history_name_text is gui_label_text
style history_text is gui_text
style history_text is gui_text
style history_label is gui_label
style history_label_text is gui_label_text
style history_window:
xfill True
ysize gui.history_height
style history_name:
xpos gui.history_name_xpos
xanchor gui.history_name_xalign
ypos gui.history_name_ypos
xsize gui.history_name_width
style history_name_text:
min_width gui.history_name_width
text_align gui.history_name_xalign
style history_text:
xpos gui.history_text_xpos
ypos gui.history_text_ypos
xanchor gui.history_text_xalign
xsize gui.history_text_width
min_width gui.history_text_width
text_align gui.history_text_xalign
layout ("subtitle" if gui.history_text_xalign else "tex")
style history_label:
xfill True
style history_label_text:
xalign 0.5
## Help screen #################################################################
##
## A screen that gives information about key and mouse bindings. It uses other
## screens (keyboard_help, mouse_help, and gamepad_help) to display the actual
## help.
screen help():
tag menu
default device = "keyboard"
use game_menu(_("Help"), scroll="viewport"):
style_prefix "help"
vbox:
spacing 23
hbox:
textbutton _("Keyboard") action SetScreenVariable("device", "keyboard")
textbutton _("Mouse") action SetScreenVariable("device", "mouse")
if GamepadExists():
textbutton _("Gamepad") action SetScreenVariable("device", "gamepad")
if device == "keyboard":
use keyboard_help
elif device == "mouse":
use mouse_help
elif device == "gamepad":
use gamepad_help
screen keyboard_help():
hbox:
label _("Enter")
text _("Advances dialogue and activates the interface.")
hbox:
label _("Space")
text _("Advances dialogue without selecting choices.")
hbox: