马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 blackpineapple 于 2023-8-12 09:16 编辑
2023年暑假界面班通知
https://www.renpy.cn/forum.php?mod=viewthread&tid=1389&extra=page%3D1
第三周
界面美术文件请见暑假班通知,或者群下载。
本周我们来制作设置界面。
[RenPy] 纯文本查看 复制代码 # The script of the game goes in this file.
# Declare characters used by this game. The color argument colorizes the
# name of the character.
default dialogue_on = True
default music_on = True
# The game starts here.
label start:
scene bg
jump setting
return
label setting():
show screen setting()
pause
jump setting
return
screen setting():
frame:
background "gui/setting/SettingsBackground.png"
xysize (1564, 913)
align (0.5, 0.5)
has vbox
xalign 0.5
## SETTINGS 字
text _("SETTINGS"):
size 73
color "#ebabd4"
xalign 0.5
font "fonts/theboldfont.ttf"
ypos -30
## MASTER VOLUME 字
text _("MASTER VOLUME"):
size 42
color "#44527d"
xalign 0.5
font "fonts/theboldfont.ttf"
## MASTER VOLUME bar
frame:
background "gui/setting/frame_s.png"
xysize (750, 153)
xalign 0.5
has hbox
spacing 20
yalign 0.4
xalign 0.5
bar:
value Preference("main volume")
xysize (560, 51)
align (0.5, 0.5)
left_bar "gui/setting/full.png"
right_bar "gui/setting/empty.png"
thumb "gui/setting/VolumeKnob.png"
thumb_offset 5
## 把文字包在frame里面,否则文字因为可能是0% - 100%就是2位或者4位
## 会导致bar移动
frame:
background Solid("#0ff0")
xysize (90, 90)
align (0.5, 0.5)
text "{:d}%".format(int(_preferences.get_volume('main') * 100)):
size 28
color "#44527d"
align (0.5, 0.5)
frame:
background "gui/setting/frame_l.png"
xysize (750, 508)
xalign 0.5
ypos 50
has vbox
spacing 30
xalign 0.5
## SOUND SETTINGS 字
text _("SOUND SETTINGS"):
size 42
color "#44527d"
xalign 0.5
font "fonts/theboldfont.ttf"
ypos -30
hbox:
align (0.5, 0.5)
spacing 100
vbox:
text _("Dialogue"):
size 25
color "#000"
xalign 0.5
ypos -5
frame:
background "gui/setting/SwitchBackground.png"
xysize (149, 53)
has hbox
align (0.5, 0.5)
button:
background None
selected_background "gui/setting/Switch.png"
xysize (75, 53)
align (0.5, 0.5)
text _("ON"):
align (0.5, 0.5)
font "fonts/theboldfont.ttf"
selected dialogue_on
action [ToggleVariable('dialogue_on')]
button:
background None
selected_background "gui/setting/Switch.png"
xysize (75, 53)
text _("OFF"):
align (0.5, 0.5)
font "fonts/theboldfont.ttf"
selected not dialogue_on
action [ToggleVariable('dialogue_on')]
vbox:
text _("Music"):
size 25
color "#000"
xalign 0.5
ypos -5
frame:
background "gui/setting/SwitchBackground.png"
xysize (149, 53)
has hbox
align (0.5, 0.5)
button:
background None
selected_background "gui/setting/Switch.png"
xysize (75, 53)
text _("ON"):
align (0.5, 0.5)
font "fonts/theboldfont.ttf"
selected music_on
action [Preference("music mute", "toggle"), ToggleVariable('music_on')]
button:
background None
selected_background "gui/setting/Switch.png"
xysize (75, 53)
text _("OFF"):
align (0.5, 0.5)
font "fonts/theboldfont.ttf"
selected not music_on
action [Preference("music mute", "toggle"), ToggleVariable('music_on')]
vbox:
text "Sound Effectes Volume":
size 28
color "#44527d"
align (0.5, 0.5)
hbox:
bar:
value Preference("sound volume")
xysize (560, 51)
align (0.5, 0.5)
left_bar "gui/setting/full.png"
right_bar "gui/setting/empty.png"
thumb "gui/setting/VolumeKnob.png"
thumb_offset 5
frame:
background Solid("#0ff0")
xysize (90, 90)
align (0.5, 0.5)
text "{:d}%".format(int(_preferences.get_volume('sfx') * 100)):
size 28
color "#44527d"
align (0.5, 0.5)
vbox:
text "Music Volume":
size 28
color "#44527d"
align (0.5, 0.5)
hbox:
bar:
value Preference("music volume")
xysize (560, 51)
align (0.5, 0.5)
left_bar "gui/setting/full.png"
right_bar "gui/setting/empty.png"
thumb "gui/setting/VolumeKnob.png"
thumb_offset 5
frame:
background Solid("#0ff0")
xysize (90, 90)
align (0.5, 0.5)
text "{:d}%".format(int(_preferences.get_volume('music') * 100)):
size 28
color "#44527d"
align (0.5, 0.5)
最后效果
|