本帖最后由 若见的我 于 2023-7-13 23:20 编辑
尝试一下最大化的代码还原实现
1、重复的属性写在样式里,多次复用,删除了用不到的样式
2、不知道为啥用imagebutton时zoom不生效,最后全都换成button了
[RenPy] 纯文本查看 复制代码 screen main_menu():
## 此语句可确保替换掉任何其他菜单屏幕。
tag menu
add "gui_new/main_menu/HomeScreenBackground.jpg" at truecenter
style_prefix "main_menu"
vbox:
align (0.5,0.7)
vbox:
spacing -20
add Text("dating sim!", size = 110, color = "#ECABD3", style = "main_menu_title" )
add Text("UI PACK", size = 70, color = "#76AFDB", style = "main_menu_title" ) at right
spacing 80
vbox:
spacing 50
button :
idle_background Image("gui_new/main_menu/Button.png", style = "main_menu_image")
hover_background Image("gui_new/main_menu/ButtonPressed.png", style = "main_menu_image")
text("START NEW GAME")
action Start()
button :
idle_background Image("gui_new/main_menu/Button.png", style = "main_menu_image")
hover_background Image("gui_new/main_menu/ButtonPressed.png", style = "main_menu_image")
text("CHECK MESSAGES")
action ()
button :
xalign 0.5 # 不居中会左偏,不知原因
idle_background Image("gui_new/main_menu/Button.png", style = "main_menu_image")
hover_background Image("gui_new/main_menu/ButtonPressed.png", style = "main_menu_image")
text("CHARACTERS")
action ()
button:
align(1.0, 1.0)
xysize(286,161)
idle_background "gui_new/main_menu/GreenBtn.png"
hover_background "gui_new/main_menu/GreenBtnPressed.png"
add Image("gui_new/main_menu/Settings.png", style = "main_menu_image") zoom 0.5
action ()
style main_menu_vbox is vbox
style main_menu_text is gui_text
style main_menu_vbox:
align (0.5,0.5)
xmaximum 1200
style main_menu_text:
properties gui.text_properties("main_menu", accent=True)
align (0.5,0.5)
font "gui_new/main_menu/theboldfont.ttf"
size 40
color "#58597C"
style main_menu_title:
align (0.5,0.5)
font "gui_new/main_menu/theboldfont.ttf"
outlines [ (6, "#fff", 0, 0) ]
style main_menu_image:
align (0.5,0.5)
[RenPy] 纯文本查看 复制代码 screen confirm(message, yes_action, no_action):
## 显示此屏幕时,确保其他屏幕无法输入。
modal True
zorder 200
frame style "confirm_frame":
vbox:
align(0.5,0.2)
text(message) style "confirm_prompt_text"
hbox:
align(0.5,0.7)
spacing 100
button:
xsize 200
ysize 150
idle_background Image("gui_new/confirm/BlueBtn.png", style = "confirm_button_image" )
hover_background Image("gui_new/confirm/BlueBtnPressed.png", style = "confirm_button_image" )
text _("YES") style "confirm_button_text"
action yes_action
button:
xsize 200
ysize 150
idle_background Image("gui_new/confirm/RedBtn.png", style = "confirm_button_image" )
hover_background Image("gui_new/confirm/RedBtnPressed.png", style = "confirm_button_image" )
text _("NO") style "confirm_button_text"
action no_action
## 右键点击退出并答复 no(取消)。
key "game_menu" action no_action
style confirm_frame is gui_frame
style confirm_prompt_text is gui_prompt_text
style confirm_button_text is gui_medium_button_text
style confirm_frame:
background Frame(["gui_new/confirm/TextContainer.png"], gui.confirm_frame_borders, tile=gui.frame_tile)
padding gui.confirm_frame_borders.padding
align(0.5,0.5)
xysize(825,440)
style confirm_prompt_text:
# font "gui_new/main_menu/theboldfont.ttf" # 无中文字体
color "#44517F"
size 38
bold True
layout "subtitle"
style confirm_button_text:
properties gui.button_text_properties("confirm_button")
align(0.5,0.5)
font "gui_new/main_menu/theboldfont.ttf"
color "#fff"
style confirm_button_image:
align(0.5,0.5)
|