+10
-10
@@ -697,7 +697,7 @@ style page_label:
|
||||
ypadding gui.scale(3)
|
||||
|
||||
style page_label_text:
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
layout "subtitle"
|
||||
hover_color gui.hover_color
|
||||
|
||||
@@ -945,7 +945,7 @@ style history_name:
|
||||
|
||||
style history_name_text:
|
||||
min_width gui.history_name_width
|
||||
text_align gui.history_name_xalign
|
||||
textalign gui.history_name_xalign
|
||||
|
||||
style history_text:
|
||||
xpos gui.history_text_xpos
|
||||
@@ -953,7 +953,7 @@ style history_text:
|
||||
xanchor gui.history_text_xalign
|
||||
xsize gui.history_text_width
|
||||
min_width gui.history_text_width
|
||||
text_align gui.history_text_xalign
|
||||
textalign gui.history_text_xalign
|
||||
layout ("subtitle" if gui.history_text_xalign else "tex")
|
||||
|
||||
style history_label:
|
||||
@@ -1122,7 +1122,7 @@ style help_label:
|
||||
style help_label_text:
|
||||
size gui.text_size
|
||||
xalign 1.0
|
||||
text_align 1.0
|
||||
textalign 1.0
|
||||
|
||||
|
||||
|
||||
@@ -1184,7 +1184,7 @@ style confirm_frame:
|
||||
yalign .5
|
||||
|
||||
style confirm_prompt_text:
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
layout "subtitle"
|
||||
|
||||
style confirm_button:
|
||||
@@ -1378,7 +1378,7 @@ style nvl_label:
|
||||
yanchor 0.0
|
||||
xsize gui.nvl_name_width
|
||||
min_width gui.nvl_name_width
|
||||
text_align gui.nvl_name_xalign
|
||||
textalign gui.nvl_name_xalign
|
||||
|
||||
style nvl_dialogue:
|
||||
xpos gui.nvl_text_xpos
|
||||
@@ -1386,7 +1386,7 @@ style nvl_dialogue:
|
||||
ypos gui.nvl_text_ypos
|
||||
xsize gui.nvl_text_width
|
||||
min_width gui.nvl_text_width
|
||||
text_align gui.nvl_text_xalign
|
||||
textalign gui.nvl_text_xalign
|
||||
layout ("subtitle" if gui.nvl_text_xalign else "tex")
|
||||
|
||||
style nvl_thought:
|
||||
@@ -1395,7 +1395,7 @@ style nvl_thought:
|
||||
ypos gui.nvl_thought_ypos
|
||||
xsize gui.nvl_thought_width
|
||||
min_width gui.nvl_thought_width
|
||||
text_align gui.nvl_thought_xalign
|
||||
textalign gui.nvl_thought_xalign
|
||||
layout ("subtitle" if gui.nvl_text_xalign else "tex")
|
||||
|
||||
style nvl_button:
|
||||
@@ -1453,12 +1453,12 @@ style bubble_namebox:
|
||||
|
||||
style bubble_who:
|
||||
xalign 0.5
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
color "#000"
|
||||
|
||||
style bubble_what:
|
||||
align (0.5, 0.5)
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
layout "subtitle"
|
||||
color "#000"
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ screen common:
|
||||
has vbox
|
||||
|
||||
text message:
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
xalign 0.5
|
||||
layout "subtitle"
|
||||
|
||||
@@ -211,7 +211,7 @@ screen common:
|
||||
add SPACER
|
||||
|
||||
text submessage:
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
xalign 0.5
|
||||
layout "subtitle"
|
||||
|
||||
@@ -250,7 +250,7 @@ screen launcher_input:
|
||||
has vbox
|
||||
|
||||
text message:
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
xalign 0.5
|
||||
layout "subtitle"
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ screen navigation:
|
||||
if persistent.navigation == "todo":
|
||||
|
||||
text _("No TODO comments found.\n\nTo create one, include \"# TODO\" in your script."):
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
|
||||
@@ -279,4 +279,3 @@ label navigation_loop:
|
||||
label navigation_refresh:
|
||||
$ project.current.update_dump(True)
|
||||
jump navigation_loop
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ screen choose_language():
|
||||
style "l_label_text"
|
||||
|
||||
size 36
|
||||
text_align .5
|
||||
textalign .5
|
||||
layout "subtitle"
|
||||
|
||||
add SPACER
|
||||
@@ -377,7 +377,7 @@ screen choose_language():
|
||||
text_style "l_default"
|
||||
|
||||
text_size 30
|
||||
text_text_align .5
|
||||
text_textalign .5
|
||||
text_layout "subtitle"
|
||||
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@ style l_alternate is l_default:
|
||||
style l_alternate_text is l_default:
|
||||
size size(14)
|
||||
font light_font()
|
||||
text_align 1.0
|
||||
textalign 1.0
|
||||
|
||||
style l_small_button is l_button
|
||||
|
||||
@@ -488,7 +488,7 @@ style l_info_button is l_button:
|
||||
xmargin 50
|
||||
|
||||
style l_info_button_text is l_button_text:
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
layout "subtitle"
|
||||
|
||||
# Progress bar.
|
||||
|
||||
@@ -56,7 +56,7 @@ init -1500:
|
||||
|
||||
style _console_prompt is _console_text:
|
||||
minwidth gui._scale(22)
|
||||
text_align 1.0
|
||||
textalign 1.0
|
||||
|
||||
style _console_input_text is _console_text:
|
||||
color "#000000"
|
||||
|
||||
@@ -1547,7 +1547,7 @@ screen director_lines(state):
|
||||
text "[line_pos]":
|
||||
xpos (gui._scale(300) - 10)
|
||||
xanchor 1.0
|
||||
text_align 1.0
|
||||
textalign 1.0
|
||||
style "director_text"
|
||||
|
||||
if change_action:
|
||||
|
||||
@@ -351,7 +351,7 @@ init -1150 python in gui:
|
||||
:propref:`xalign`
|
||||
To gui.kind_text_xalign, if it exists.
|
||||
|
||||
:propref:`text_align`
|
||||
:propref:`textalign`
|
||||
To gui.kind_text_xalign, if it exists.
|
||||
|
||||
:propref:`layout`
|
||||
@@ -413,6 +413,7 @@ init -1150 python in gui:
|
||||
if xalign is not None:
|
||||
rv["xalign"] = xalign
|
||||
rv["text_align"] = xalign
|
||||
rv["textalign"] = xalign
|
||||
|
||||
if (xalign > 0) and (xalign < 1):
|
||||
rv["layout"] = "subtitle"
|
||||
|
||||
@@ -693,7 +693,7 @@ python early in layeredimage:
|
||||
size=16,
|
||||
xalign=0.5,
|
||||
yalign=0.5,
|
||||
text_align=0.5,
|
||||
textalign=0.5,
|
||||
color="#fff",
|
||||
outlines=[ (1, "#0008", 0, 0) ],
|
||||
)
|
||||
|
||||
@@ -62,7 +62,7 @@ init -1500 python:
|
||||
|
||||
# Set up nvl mode styles.
|
||||
style.nvl_label.minwidth = 150
|
||||
style.nvl_label.text_align = 1.0
|
||||
style.nvl_label.textalign = 1.0
|
||||
|
||||
style.nvl_window.background = "#0008"
|
||||
style.nvl_window.yfill = True
|
||||
|
||||
@@ -67,9 +67,9 @@ init -1500 python:
|
||||
If true, the sprite is flipped horizontally.
|
||||
|
||||
`text`
|
||||
If provided, no other text than this will be displayed on the
|
||||
placeholder. If not, the text will reflect the show
|
||||
instruction that was used to display it.
|
||||
If provided, no other text than this will be displayed on the
|
||||
placeholder. If not, the text will reflect the show
|
||||
instruction that was used to display it.
|
||||
"""
|
||||
|
||||
super(Placeholder, self).__init__(**properties)
|
||||
@@ -149,7 +149,7 @@ init -1500 python:
|
||||
if base == "bg":
|
||||
rv = Fixed(
|
||||
Solid("#aaa"),
|
||||
Text(" ".join(self.name), style="_default", color="#333333", text_align=0.5, xalign=0.5, ypos=5),
|
||||
Text(" ".join(self.name), style="_default", color="#333333", textalign=0.5, xalign=0.5, ypos=5),
|
||||
alt="",
|
||||
)
|
||||
|
||||
@@ -190,7 +190,7 @@ init -1500 python:
|
||||
|
||||
rv = Fixed(
|
||||
Transform(image, crop=crop, size=size, xzoom=xzoom),
|
||||
Text(text, pos=textpos, xanchor=0.5, yanchor=0.5, style="_default", color="#aaa", text_align=0.5),
|
||||
Text(text, pos=textpos, xanchor=0.5, yanchor=0.5, style="_default", color="#aaa", textalign=0.5),
|
||||
xysize=size,
|
||||
alt="",
|
||||
)
|
||||
|
||||
@@ -152,7 +152,7 @@ init -1800:
|
||||
outlines [ ]
|
||||
outline_scaling "linear"
|
||||
minwidth 0
|
||||
text_align 0
|
||||
textalign 0
|
||||
justify False
|
||||
text_y_fudge 0
|
||||
first_indent 0
|
||||
|
||||
@@ -516,7 +516,7 @@ init -1100:
|
||||
|
||||
text _("This will upload your saves to the {a=https://sync.renpy.org}Ren'Py Sync Server{/a}.\nDo you want to continue?"):
|
||||
xalign 0.5
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
|
||||
hbox:
|
||||
xalign 0.5
|
||||
@@ -548,7 +548,7 @@ init -1100:
|
||||
|
||||
text prompt:
|
||||
xalign 0.5
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
|
||||
input:
|
||||
id "input"
|
||||
@@ -556,7 +556,7 @@ init -1100:
|
||||
|
||||
text _("This will contact the {a=https://sync.renpy.org}Ren'Py Sync Server{/a}."):
|
||||
xalign 0.5
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
|
||||
textbutton _("Cancel"):
|
||||
action Return("")
|
||||
@@ -592,7 +592,7 @@ init -1100:
|
||||
|
||||
text _("You can use this ID to download your save on another device.\nThis sync will expire in an hour.\nRen'Py Sync is supported by {a=https://www.renpy.org/sponsors.html}Ren'Py's Sponsors{/a}."):
|
||||
xalign 0.5
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
|
||||
textbutton _("Continue"):
|
||||
action Return(True)
|
||||
|
||||
@@ -155,7 +155,7 @@ init -1110 python hide:
|
||||
|
||||
style.button_text.xalign = 0.5
|
||||
style.button_text.yalign = 0.5
|
||||
style.button_text.text_align = 0.5
|
||||
style.button_text.textalign = 0.5
|
||||
|
||||
setattr(theme, name + "_buttons", buttons)
|
||||
|
||||
@@ -215,7 +215,7 @@ init -1110 python hide:
|
||||
style.prompt_text.color = label
|
||||
|
||||
style.prompt.xalign = 0.5
|
||||
style.prompt_text.text_align = 0.5
|
||||
style.prompt_text.textalign = 0.5
|
||||
style.prompt_text.layout = "subtitle"
|
||||
|
||||
setattr(theme, name + "_prompts", prompts)
|
||||
@@ -455,7 +455,7 @@ init -1110 python hide:
|
||||
style.button_text.selected_hover_color = bright_red
|
||||
|
||||
style.button_text.xalign = 0.5
|
||||
style.button_text.text_align = 0.5
|
||||
style.button_text.textalign = 0.5
|
||||
|
||||
style.bar.ymaximum = 22
|
||||
style.bar.left_bar = Solid(bright_cyan)
|
||||
@@ -509,7 +509,7 @@ init -1110 python hide:
|
||||
style.large_button_text.size = 16
|
||||
style.large_button_text.drop_shadow = (1, 1)
|
||||
style.large_button_text.xalign = 0
|
||||
style.large_button_text.text_align = 0
|
||||
style.large_button_text.textalign = 0
|
||||
|
||||
style.label_text.size = 24
|
||||
style.label_text.color = green
|
||||
@@ -519,7 +519,7 @@ init -1110 python hide:
|
||||
style.prompt_text.size = 24
|
||||
style.prompt_text.color = green
|
||||
style.prompt_text.layout = "subtitle"
|
||||
style.prompt_text.text_align = 0.5
|
||||
style.prompt_text.textalign = 0.5
|
||||
style.prompt_text.drop_shadow = (1, 1)
|
||||
style.prompt_text.drop_shadow_color = "#000"
|
||||
|
||||
@@ -872,7 +872,7 @@ init -1110 python hide:
|
||||
|
||||
style.button_text.xalign = 0.5
|
||||
style.button_text.yalign = 0.5
|
||||
style.button_text.text_align = 0.5
|
||||
style.button_text.textalign = 0.5
|
||||
|
||||
# Radio Buttons
|
||||
|
||||
@@ -912,7 +912,7 @@ init -1110 python hide:
|
||||
|
||||
|
||||
s.xalign = 0.0
|
||||
s.text_align = 0.0
|
||||
s.textalign = 0.0
|
||||
|
||||
set_radio_style(style.radio_button, widget)
|
||||
set_radio_text_style(style.radio_button_text)
|
||||
@@ -981,7 +981,7 @@ init -1110 python hide:
|
||||
|
||||
style.large_button_text.xalign = 0.5
|
||||
style.large_button_text.yalign = 0.5
|
||||
style.large_button_text.text_align = 0.5
|
||||
style.large_button_text.textalign = 0.5
|
||||
|
||||
@theme
|
||||
def a_white_tulip_labels(
|
||||
@@ -1014,7 +1014,7 @@ init -1110 python hide:
|
||||
style.prompt_text.color = label
|
||||
|
||||
style.prompt.xalign = 0.5
|
||||
style.prompt_text.text_align = 0.5
|
||||
style.prompt_text.textalign = 0.5
|
||||
style.prompt_text.layout = "subtitle"
|
||||
|
||||
@theme
|
||||
|
||||
+228
-228
@@ -1,228 +1,228 @@
|
||||
# Copyright 2020 Sylvain Beucler
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
# (the "Software"), to deal in the Software without restriction,
|
||||
# including without limitation the rights to use, copy, modify, merge,
|
||||
# publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
# and to permit persons to whom the Software is furnished to do so,
|
||||
# subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
init -1500 python:
|
||||
|
||||
import pygame_sdl2
|
||||
|
||||
@renpy.pure
|
||||
class _TouchKeyboardTextInput(Action, DictEquality):
|
||||
"""
|
||||
Simulate text input
|
||||
"""
|
||||
|
||||
def __init__(self, char):
|
||||
self.char = char
|
||||
|
||||
def __call__(self):
|
||||
import pygame_sdl2
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.TEXTINPUT,
|
||||
text=self.char))
|
||||
|
||||
@renpy.pure
|
||||
class _TouchKeyboardBackspace(Action, DictEquality):
|
||||
"""
|
||||
Simulate backspace
|
||||
"""
|
||||
|
||||
def __call__(self):
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.KEYDOWN,
|
||||
key=pygame_sdl2.K_BACKSPACE,
|
||||
scancode=pygame_sdl2.K_BACKSPACE,
|
||||
unicode='', mod=0, repeat=False,
|
||||
))
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.KEYUP,
|
||||
key=pygame_sdl2.K_BACKSPACE,
|
||||
scancode=pygame_sdl2.K_BACKSPACE,
|
||||
unicode='', mod=0, repeat=False,
|
||||
))
|
||||
|
||||
@renpy.pure
|
||||
class _TouchKeyboardReturn(Action, DictEquality):
|
||||
"""
|
||||
Simulate return
|
||||
"""
|
||||
|
||||
def __call__(self):
|
||||
import pygame_sdl2
|
||||
|
||||
# avoid loop when K_RETURN activates our button
|
||||
renpy.exports.hide_screen('_touch_keyboard', layer='screens')
|
||||
renpy.restart_interaction()
|
||||
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.KEYDOWN,
|
||||
key=pygame_sdl2.K_RETURN,
|
||||
scancode=pygame_sdl2.K_RETURN,
|
||||
unicode='', mod=0, repeat=False,
|
||||
))
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.KEYUP,
|
||||
key=pygame_sdl2.K_RETURN,
|
||||
scancode=pygame_sdl2.K_RETURN,
|
||||
unicode='', mod=0, repeat=False,
|
||||
))
|
||||
|
||||
init -1500:
|
||||
|
||||
transform _touch_keyboard:
|
||||
mesh True
|
||||
alpha 0.6
|
||||
xalign 0.5
|
||||
|
||||
style _touch_keyboard_button:
|
||||
hover_background "#f00"
|
||||
|
||||
style _touch_keyboard_button_text:
|
||||
color "#fff"
|
||||
font "DejaVuSans.ttf"
|
||||
outlines [ (absolute(3), "#000", absolute(0), absolute(0)) ]
|
||||
size gui._scale(55)
|
||||
min_width gui._scale(55)
|
||||
text_align 0.5
|
||||
|
||||
screen _touch_keyboard:
|
||||
zorder 1100
|
||||
style_prefix "_touch_keyboard"
|
||||
|
||||
hbox:
|
||||
at _touch_keyboard
|
||||
|
||||
grid 7 7:
|
||||
textbutton "A" action _TouchKeyboardTextInput('A')
|
||||
textbutton "B" action _TouchKeyboardTextInput('B')
|
||||
textbutton "C" action _TouchKeyboardTextInput('C')
|
||||
textbutton "D" action _TouchKeyboardTextInput('D')
|
||||
textbutton "E" action _TouchKeyboardTextInput('E')
|
||||
textbutton "F" action _TouchKeyboardTextInput('F')
|
||||
textbutton "G" action _TouchKeyboardTextInput('G')
|
||||
|
||||
textbutton "H" action _TouchKeyboardTextInput('H')
|
||||
textbutton "I" action _TouchKeyboardTextInput('I')
|
||||
textbutton "J" action _TouchKeyboardTextInput('J')
|
||||
textbutton "K" action _TouchKeyboardTextInput('K')
|
||||
textbutton "L" action _TouchKeyboardTextInput('L')
|
||||
textbutton "M" action _TouchKeyboardTextInput('M')
|
||||
textbutton "N" action _TouchKeyboardTextInput('N')
|
||||
|
||||
textbutton "O" action _TouchKeyboardTextInput('O')
|
||||
textbutton "P" action _TouchKeyboardTextInput('P')
|
||||
textbutton "Q" action _TouchKeyboardTextInput('Q')
|
||||
textbutton "R" action _TouchKeyboardTextInput('R')
|
||||
textbutton "S" action _TouchKeyboardTextInput('S')
|
||||
textbutton "T" action _TouchKeyboardTextInput('T')
|
||||
textbutton "U" action _TouchKeyboardTextInput('U')
|
||||
|
||||
textbutton "V" action _TouchKeyboardTextInput('V')
|
||||
textbutton "W" action _TouchKeyboardTextInput('W')
|
||||
textbutton "X" action _TouchKeyboardTextInput('X')
|
||||
textbutton "Y" action _TouchKeyboardTextInput('Y')
|
||||
textbutton "Z" action _TouchKeyboardTextInput('Z')
|
||||
null
|
||||
null
|
||||
|
||||
textbutton "+" action _TouchKeyboardTextInput('+')
|
||||
textbutton "-" action _TouchKeyboardTextInput('-')
|
||||
textbutton "0" action _TouchKeyboardTextInput('0')
|
||||
textbutton "1" action _TouchKeyboardTextInput('1')
|
||||
textbutton "2" action _TouchKeyboardTextInput('2')
|
||||
textbutton "3" action _TouchKeyboardTextInput('3')
|
||||
textbutton "4" action _TouchKeyboardTextInput('4')
|
||||
|
||||
textbutton "*" action _TouchKeyboardTextInput('*')
|
||||
textbutton "/" action _TouchKeyboardTextInput('/')
|
||||
textbutton "5" action _TouchKeyboardTextInput('5')
|
||||
textbutton "6" action _TouchKeyboardTextInput('6')
|
||||
textbutton "7" action _TouchKeyboardTextInput('7')
|
||||
textbutton "8" action _TouchKeyboardTextInput('8')
|
||||
textbutton "9" action _TouchKeyboardTextInput('9')
|
||||
|
||||
|
||||
textbutton "#" action _TouchKeyboardTextInput('#')
|
||||
textbutton "$" action _TouchKeyboardTextInput('$')
|
||||
textbutton "=" action _TouchKeyboardTextInput('=')
|
||||
textbutton "<" action _TouchKeyboardTextInput('<')
|
||||
textbutton ">" action _TouchKeyboardTextInput('>')
|
||||
textbutton "_" action _TouchKeyboardTextInput('_')
|
||||
null
|
||||
|
||||
null width 30
|
||||
|
||||
grid 7 7:
|
||||
textbutton "a" action _TouchKeyboardTextInput('a')
|
||||
textbutton "b" action _TouchKeyboardTextInput('b')
|
||||
textbutton "c" action _TouchKeyboardTextInput('c')
|
||||
textbutton "d" action _TouchKeyboardTextInput('d')
|
||||
textbutton "e" action _TouchKeyboardTextInput('e')
|
||||
textbutton "f" action _TouchKeyboardTextInput('f')
|
||||
textbutton "g" action _TouchKeyboardTextInput('g')
|
||||
|
||||
textbutton "h" action _TouchKeyboardTextInput('h')
|
||||
textbutton "i" action _TouchKeyboardTextInput('i')
|
||||
textbutton "j" action _TouchKeyboardTextInput('j')
|
||||
textbutton "k" action _TouchKeyboardTextInput('k')
|
||||
textbutton "l" action _TouchKeyboardTextInput('l')
|
||||
textbutton "m" action _TouchKeyboardTextInput('m')
|
||||
textbutton "n" action _TouchKeyboardTextInput('n')
|
||||
|
||||
textbutton "o" action _TouchKeyboardTextInput('o')
|
||||
textbutton "p" action _TouchKeyboardTextInput('p')
|
||||
textbutton "q" action _TouchKeyboardTextInput('q')
|
||||
textbutton "r" action _TouchKeyboardTextInput('r')
|
||||
textbutton "s" action _TouchKeyboardTextInput('s')
|
||||
textbutton "t" action _TouchKeyboardTextInput('t')
|
||||
textbutton "u" action _TouchKeyboardTextInput('u')
|
||||
|
||||
textbutton "v" action _TouchKeyboardTextInput('v')
|
||||
textbutton "w" action _TouchKeyboardTextInput('w')
|
||||
textbutton "x" action _TouchKeyboardTextInput('x')
|
||||
textbutton "y" action _TouchKeyboardTextInput('y')
|
||||
textbutton "z" action _TouchKeyboardTextInput('z')
|
||||
null
|
||||
null
|
||||
|
||||
textbutton "|" action _TouchKeyboardTextInput('|')
|
||||
textbutton "~" action _TouchKeyboardTextInput('~')
|
||||
textbutton "%" action _TouchKeyboardTextInput('%')
|
||||
textbutton "&" action _TouchKeyboardTextInput('&')
|
||||
textbutton "@" action _TouchKeyboardTextInput('@')
|
||||
textbutton "(" action _TouchKeyboardTextInput('(')
|
||||
textbutton ")" action _TouchKeyboardTextInput(')')
|
||||
|
||||
|
||||
textbutton "." action _TouchKeyboardTextInput('.')
|
||||
textbutton "!" action _TouchKeyboardTextInput('!')
|
||||
textbutton ":" action _TouchKeyboardTextInput(':')
|
||||
textbutton ";" action _TouchKeyboardTextInput(';')
|
||||
textbutton "\"" action _TouchKeyboardTextInput('\"')
|
||||
null
|
||||
null
|
||||
|
||||
textbutton "␣" action _TouchKeyboardTextInput(' ')
|
||||
null
|
||||
null
|
||||
textbutton "←" action _TouchKeyboardBackspace()
|
||||
null
|
||||
null
|
||||
textbutton "⏎" action _TouchKeyboardReturn()
|
||||
# Copyright 2020 Sylvain Beucler
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
# (the "Software"), to deal in the Software without restriction,
|
||||
# including without limitation the rights to use, copy, modify, merge,
|
||||
# publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
# and to permit persons to whom the Software is furnished to do so,
|
||||
# subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
init -1500 python:
|
||||
|
||||
import pygame_sdl2
|
||||
|
||||
@renpy.pure
|
||||
class _TouchKeyboardTextInput(Action, DictEquality):
|
||||
"""
|
||||
Simulate text input
|
||||
"""
|
||||
|
||||
def __init__(self, char):
|
||||
self.char = char
|
||||
|
||||
def __call__(self):
|
||||
import pygame_sdl2
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.TEXTINPUT,
|
||||
text=self.char))
|
||||
|
||||
@renpy.pure
|
||||
class _TouchKeyboardBackspace(Action, DictEquality):
|
||||
"""
|
||||
Simulate backspace
|
||||
"""
|
||||
|
||||
def __call__(self):
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.KEYDOWN,
|
||||
key=pygame_sdl2.K_BACKSPACE,
|
||||
scancode=pygame_sdl2.K_BACKSPACE,
|
||||
unicode='', mod=0, repeat=False,
|
||||
))
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.KEYUP,
|
||||
key=pygame_sdl2.K_BACKSPACE,
|
||||
scancode=pygame_sdl2.K_BACKSPACE,
|
||||
unicode='', mod=0, repeat=False,
|
||||
))
|
||||
|
||||
@renpy.pure
|
||||
class _TouchKeyboardReturn(Action, DictEquality):
|
||||
"""
|
||||
Simulate return
|
||||
"""
|
||||
|
||||
def __call__(self):
|
||||
import pygame_sdl2
|
||||
|
||||
# avoid loop when K_RETURN activates our button
|
||||
renpy.exports.hide_screen('_touch_keyboard', layer='screens')
|
||||
renpy.restart_interaction()
|
||||
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.KEYDOWN,
|
||||
key=pygame_sdl2.K_RETURN,
|
||||
scancode=pygame_sdl2.K_RETURN,
|
||||
unicode='', mod=0, repeat=False,
|
||||
))
|
||||
pygame_sdl2.event.post(pygame_sdl2.event.Event(
|
||||
pygame_sdl2.KEYUP,
|
||||
key=pygame_sdl2.K_RETURN,
|
||||
scancode=pygame_sdl2.K_RETURN,
|
||||
unicode='', mod=0, repeat=False,
|
||||
))
|
||||
|
||||
init -1500:
|
||||
|
||||
transform _touch_keyboard:
|
||||
mesh True
|
||||
alpha 0.6
|
||||
xalign 0.5
|
||||
|
||||
style _touch_keyboard_button:
|
||||
hover_background "#f00"
|
||||
|
||||
style _touch_keyboard_button_text:
|
||||
color "#fff"
|
||||
font "DejaVuSans.ttf"
|
||||
outlines [ (absolute(3), "#000", absolute(0), absolute(0)) ]
|
||||
size gui._scale(55)
|
||||
min_width gui._scale(55)
|
||||
textalign 0.5
|
||||
|
||||
screen _touch_keyboard:
|
||||
zorder 1100
|
||||
style_prefix "_touch_keyboard"
|
||||
|
||||
hbox:
|
||||
at _touch_keyboard
|
||||
|
||||
grid 7 7:
|
||||
textbutton "A" action _TouchKeyboardTextInput('A')
|
||||
textbutton "B" action _TouchKeyboardTextInput('B')
|
||||
textbutton "C" action _TouchKeyboardTextInput('C')
|
||||
textbutton "D" action _TouchKeyboardTextInput('D')
|
||||
textbutton "E" action _TouchKeyboardTextInput('E')
|
||||
textbutton "F" action _TouchKeyboardTextInput('F')
|
||||
textbutton "G" action _TouchKeyboardTextInput('G')
|
||||
|
||||
textbutton "H" action _TouchKeyboardTextInput('H')
|
||||
textbutton "I" action _TouchKeyboardTextInput('I')
|
||||
textbutton "J" action _TouchKeyboardTextInput('J')
|
||||
textbutton "K" action _TouchKeyboardTextInput('K')
|
||||
textbutton "L" action _TouchKeyboardTextInput('L')
|
||||
textbutton "M" action _TouchKeyboardTextInput('M')
|
||||
textbutton "N" action _TouchKeyboardTextInput('N')
|
||||
|
||||
textbutton "O" action _TouchKeyboardTextInput('O')
|
||||
textbutton "P" action _TouchKeyboardTextInput('P')
|
||||
textbutton "Q" action _TouchKeyboardTextInput('Q')
|
||||
textbutton "R" action _TouchKeyboardTextInput('R')
|
||||
textbutton "S" action _TouchKeyboardTextInput('S')
|
||||
textbutton "T" action _TouchKeyboardTextInput('T')
|
||||
textbutton "U" action _TouchKeyboardTextInput('U')
|
||||
|
||||
textbutton "V" action _TouchKeyboardTextInput('V')
|
||||
textbutton "W" action _TouchKeyboardTextInput('W')
|
||||
textbutton "X" action _TouchKeyboardTextInput('X')
|
||||
textbutton "Y" action _TouchKeyboardTextInput('Y')
|
||||
textbutton "Z" action _TouchKeyboardTextInput('Z')
|
||||
null
|
||||
null
|
||||
|
||||
textbutton "+" action _TouchKeyboardTextInput('+')
|
||||
textbutton "-" action _TouchKeyboardTextInput('-')
|
||||
textbutton "0" action _TouchKeyboardTextInput('0')
|
||||
textbutton "1" action _TouchKeyboardTextInput('1')
|
||||
textbutton "2" action _TouchKeyboardTextInput('2')
|
||||
textbutton "3" action _TouchKeyboardTextInput('3')
|
||||
textbutton "4" action _TouchKeyboardTextInput('4')
|
||||
|
||||
textbutton "*" action _TouchKeyboardTextInput('*')
|
||||
textbutton "/" action _TouchKeyboardTextInput('/')
|
||||
textbutton "5" action _TouchKeyboardTextInput('5')
|
||||
textbutton "6" action _TouchKeyboardTextInput('6')
|
||||
textbutton "7" action _TouchKeyboardTextInput('7')
|
||||
textbutton "8" action _TouchKeyboardTextInput('8')
|
||||
textbutton "9" action _TouchKeyboardTextInput('9')
|
||||
|
||||
|
||||
textbutton "#" action _TouchKeyboardTextInput('#')
|
||||
textbutton "$" action _TouchKeyboardTextInput('$')
|
||||
textbutton "=" action _TouchKeyboardTextInput('=')
|
||||
textbutton "<" action _TouchKeyboardTextInput('<')
|
||||
textbutton ">" action _TouchKeyboardTextInput('>')
|
||||
textbutton "_" action _TouchKeyboardTextInput('_')
|
||||
null
|
||||
|
||||
null width 30
|
||||
|
||||
grid 7 7:
|
||||
textbutton "a" action _TouchKeyboardTextInput('a')
|
||||
textbutton "b" action _TouchKeyboardTextInput('b')
|
||||
textbutton "c" action _TouchKeyboardTextInput('c')
|
||||
textbutton "d" action _TouchKeyboardTextInput('d')
|
||||
textbutton "e" action _TouchKeyboardTextInput('e')
|
||||
textbutton "f" action _TouchKeyboardTextInput('f')
|
||||
textbutton "g" action _TouchKeyboardTextInput('g')
|
||||
|
||||
textbutton "h" action _TouchKeyboardTextInput('h')
|
||||
textbutton "i" action _TouchKeyboardTextInput('i')
|
||||
textbutton "j" action _TouchKeyboardTextInput('j')
|
||||
textbutton "k" action _TouchKeyboardTextInput('k')
|
||||
textbutton "l" action _TouchKeyboardTextInput('l')
|
||||
textbutton "m" action _TouchKeyboardTextInput('m')
|
||||
textbutton "n" action _TouchKeyboardTextInput('n')
|
||||
|
||||
textbutton "o" action _TouchKeyboardTextInput('o')
|
||||
textbutton "p" action _TouchKeyboardTextInput('p')
|
||||
textbutton "q" action _TouchKeyboardTextInput('q')
|
||||
textbutton "r" action _TouchKeyboardTextInput('r')
|
||||
textbutton "s" action _TouchKeyboardTextInput('s')
|
||||
textbutton "t" action _TouchKeyboardTextInput('t')
|
||||
textbutton "u" action _TouchKeyboardTextInput('u')
|
||||
|
||||
textbutton "v" action _TouchKeyboardTextInput('v')
|
||||
textbutton "w" action _TouchKeyboardTextInput('w')
|
||||
textbutton "x" action _TouchKeyboardTextInput('x')
|
||||
textbutton "y" action _TouchKeyboardTextInput('y')
|
||||
textbutton "z" action _TouchKeyboardTextInput('z')
|
||||
null
|
||||
null
|
||||
|
||||
textbutton "|" action _TouchKeyboardTextInput('|')
|
||||
textbutton "~" action _TouchKeyboardTextInput('~')
|
||||
textbutton "%" action _TouchKeyboardTextInput('%')
|
||||
textbutton "&" action _TouchKeyboardTextInput('&')
|
||||
textbutton "@" action _TouchKeyboardTextInput('@')
|
||||
textbutton "(" action _TouchKeyboardTextInput('(')
|
||||
textbutton ")" action _TouchKeyboardTextInput(')')
|
||||
|
||||
|
||||
textbutton "." action _TouchKeyboardTextInput('.')
|
||||
textbutton "!" action _TouchKeyboardTextInput('!')
|
||||
textbutton ":" action _TouchKeyboardTextInput(':')
|
||||
textbutton ";" action _TouchKeyboardTextInput(';')
|
||||
textbutton "\"" action _TouchKeyboardTextInput('\"')
|
||||
null
|
||||
null
|
||||
|
||||
textbutton "␣" action _TouchKeyboardTextInput(' ')
|
||||
null
|
||||
null
|
||||
textbutton "←" action _TouchKeyboardBackspace()
|
||||
null
|
||||
null
|
||||
textbutton "⏎" action _TouchKeyboardReturn()
|
||||
|
||||
@@ -218,8 +218,8 @@ init python:
|
||||
style.file_picker_new.minwidth = 40
|
||||
style.file_picker_old.minwidth = 40
|
||||
|
||||
style.file_picker_new.text_align = 1.0
|
||||
style.file_picker_old.text_align = 1.0
|
||||
style.file_picker_new.textalign = 1.0
|
||||
style.file_picker_old.textalign = 1.0
|
||||
|
||||
|
||||
######################################################################
|
||||
|
||||
@@ -422,8 +422,8 @@ init -1100:
|
||||
style.file_picker_old.minwidth = 40
|
||||
style.file_picker_new.minwidth = 40
|
||||
|
||||
style.file_picker_old.text_align = 1.0
|
||||
style.file_picker_new.text_align = 1.0
|
||||
style.file_picker_old.textalign = 1.0
|
||||
style.file_picker_new.textalign = 1.0
|
||||
|
||||
if config.script_version is None or config.script_version > (6, 0, 0):
|
||||
style.file_picker_text.insensitive_color = disabled_text
|
||||
@@ -481,20 +481,20 @@ init -1100:
|
||||
style.launcher_text.xanchor = 0.5
|
||||
style.launcher_text.xmaximum = 240
|
||||
style.launcher_text.color = label
|
||||
style.launcher_text.text_align = 0.5
|
||||
style.launcher_text.textalign = 0.5
|
||||
|
||||
|
||||
style.launcher_label.xpos = 140
|
||||
style.launcher_label.xanchor = 0.5
|
||||
style.launcher_label.xmaximum = 240
|
||||
style.launcher_label.color = label
|
||||
style.launcher_label.text_align = 0.5
|
||||
style.launcher_label.textalign = 0.5
|
||||
|
||||
style.launcher_input.xpos = 140
|
||||
style.launcher_input.xanchor = 0.5
|
||||
style.launcher_input.xmaximum = 240
|
||||
style.launcher_input.color = widget
|
||||
style.launcher_input.text_align = 0.5
|
||||
style.launcher_input.textalign = 0.5
|
||||
|
||||
store._launcher_per_page = 9
|
||||
|
||||
@@ -517,4 +517,3 @@ init -1100:
|
||||
theme.roundrect(**args)
|
||||
|
||||
theme.roundrect_red = theme_roundrect_red
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ init label _errorhandling:
|
||||
outlines [ ]
|
||||
outline_scaling "step"
|
||||
minwidth 0
|
||||
text_align 0
|
||||
textalign 0
|
||||
justify False
|
||||
text_y_fudge 0
|
||||
first_indent 0
|
||||
@@ -592,7 +592,7 @@ screen _exception:
|
||||
side "c r":
|
||||
xfill True
|
||||
label _("An exception has occurred.") text_size gui._scale(40)
|
||||
text "{size=-3}[config.version!q]\n[renpy.version_only!q]\n[renpy.platform!q]{/size}" text_align 1.0 yalign 0.5
|
||||
text "{size=-3}[config.version!q]\n[renpy.version_only!q]\n[renpy.platform!q]{/size}" textalign 1.0 yalign 0.5
|
||||
|
||||
viewport:
|
||||
id "viewport"
|
||||
|
||||
@@ -98,6 +98,7 @@ text_property_names = [
|
||||
"slow_cps_multiplier",
|
||||
"slow_abortable",
|
||||
"strikethrough",
|
||||
"textalign",
|
||||
"text_align",
|
||||
"text_y_fudge",
|
||||
"underline",
|
||||
|
||||
@@ -681,7 +681,7 @@ style page_label:
|
||||
ypadding 5
|
||||
|
||||
style page_label_text:
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
layout "subtitle"
|
||||
hover_color gui.hover_color
|
||||
|
||||
@@ -935,7 +935,7 @@ style history_name:
|
||||
|
||||
style history_name_text:
|
||||
min_width gui.history_name_width
|
||||
text_align gui.history_name_xalign
|
||||
textalign gui.history_name_xalign
|
||||
|
||||
style history_text:
|
||||
xpos gui.history_text_xpos
|
||||
@@ -943,7 +943,7 @@ style history_text:
|
||||
xanchor gui.history_text_xalign
|
||||
xsize gui.history_text_width
|
||||
min_width gui.history_text_width
|
||||
text_align gui.history_text_xalign
|
||||
textalign gui.history_text_xalign
|
||||
layout ("subtitle" if gui.history_text_xalign else "tex")
|
||||
|
||||
style history_label:
|
||||
@@ -1107,7 +1107,7 @@ style help_label:
|
||||
style help_label_text:
|
||||
size gui.text_size
|
||||
xalign 1.0
|
||||
text_align 1.0
|
||||
textalign 1.0
|
||||
|
||||
|
||||
|
||||
@@ -1169,7 +1169,7 @@ style confirm_frame:
|
||||
yalign .5
|
||||
|
||||
style confirm_prompt_text:
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
layout "subtitle"
|
||||
|
||||
style confirm_button:
|
||||
@@ -1363,7 +1363,7 @@ style nvl_label:
|
||||
yanchor 0.0
|
||||
xsize gui.nvl_name_width
|
||||
min_width gui.nvl_name_width
|
||||
text_align gui.nvl_name_xalign
|
||||
textalign gui.nvl_name_xalign
|
||||
|
||||
style nvl_dialogue:
|
||||
xpos gui.nvl_text_xpos
|
||||
@@ -1371,7 +1371,7 @@ style nvl_dialogue:
|
||||
ypos gui.nvl_text_ypos
|
||||
xsize gui.nvl_text_width
|
||||
min_width gui.nvl_text_width
|
||||
text_align gui.nvl_text_xalign
|
||||
textalign gui.nvl_text_xalign
|
||||
layout ("subtitle" if gui.nvl_text_xalign else "tex")
|
||||
|
||||
style nvl_thought:
|
||||
@@ -1380,7 +1380,7 @@ style nvl_thought:
|
||||
ypos gui.nvl_thought_ypos
|
||||
xsize gui.nvl_thought_width
|
||||
min_width gui.nvl_thought_width
|
||||
text_align gui.nvl_thought_xalign
|
||||
textalign gui.nvl_thought_xalign
|
||||
layout ("subtitle" if gui.nvl_text_xalign else "tex")
|
||||
|
||||
style nvl_button:
|
||||
|
||||
@@ -755,7 +755,7 @@ If no ``confirm`` screen is present, ``yesno_prompt`` is used instead.
|
||||
spacing 25
|
||||
|
||||
text _(message):
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
xalign 0.5
|
||||
|
||||
hbox:
|
||||
|
||||
@@ -483,7 +483,7 @@ Here's an example of dismiss being used::
|
||||
|
||||
text "This is a very important message.":
|
||||
xalign 0.5
|
||||
text_align 0.5
|
||||
textalign 0.5
|
||||
|
||||
# Dismiss can be confusing on its own, so we'll add a button as well.
|
||||
textbutton "Dismiss":
|
||||
|
||||
@@ -585,7 +585,7 @@ Text Style Properties
|
||||
.. style-property:: min_width int
|
||||
|
||||
Sets the minimum width of each line of that. If a line is shorter
|
||||
than this, it is padded to this length, with ``text_align`` used to
|
||||
than this, it is padded to this length, with ``textalign`` used to
|
||||
specify where such padding is placed.
|
||||
|
||||
.. style-property:: newline_indent boolean
|
||||
@@ -675,7 +675,7 @@ Text Style Properties
|
||||
|
||||
If True, a line is drawn through the text.
|
||||
|
||||
.. style-property:: text_align float
|
||||
.. style-property:: textalign float
|
||||
|
||||
This is used when a line is shorter than the width of the text
|
||||
displayable. It determines how much of the extra space is placed
|
||||
|
||||
+498
-498
@@ -1,498 +1,498 @@
|
||||
# This file is in the public domain. Feel free to modify it as a basis
|
||||
# for your own screens.
|
||||
|
||||
##############################################################################
|
||||
# Say
|
||||
#
|
||||
# Screen that's used to display adv-mode dialogue.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#say
|
||||
|
||||
screen say:
|
||||
|
||||
# Defaults for side_image and two_window
|
||||
default side_image = None
|
||||
default two_window = False
|
||||
|
||||
# Decide if we want to use the one-window or two-window varaint.
|
||||
if not two_window:
|
||||
|
||||
# The one window variant.
|
||||
window:
|
||||
id "window"
|
||||
|
||||
has vbox:
|
||||
style "say_vbox"
|
||||
|
||||
if who:
|
||||
text who id "who"
|
||||
|
||||
text what id "what"
|
||||
|
||||
else:
|
||||
|
||||
# The two window variant.
|
||||
vbox:
|
||||
style "say_two_window_vbox"
|
||||
|
||||
if who:
|
||||
window:
|
||||
style "say_who_window"
|
||||
|
||||
text who:
|
||||
id "who"
|
||||
|
||||
window:
|
||||
id "window"
|
||||
|
||||
has vbox:
|
||||
style "say_vbox"
|
||||
|
||||
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
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Choice
|
||||
#
|
||||
# Screen that's used to display in-game menus.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#choice
|
||||
|
||||
screen choice:
|
||||
|
||||
window:
|
||||
style "menu_window"
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
|
||||
vbox:
|
||||
style "menu"
|
||||
spacing 2
|
||||
|
||||
for caption, action, chosen in items:
|
||||
|
||||
if action:
|
||||
|
||||
button:
|
||||
action action
|
||||
style "menu_choice_button"
|
||||
|
||||
text caption style "menu_choice"
|
||||
|
||||
else:
|
||||
text caption style "menu_caption"
|
||||
|
||||
init -2 python:
|
||||
config.narrator_menu = True
|
||||
|
||||
style.menu_window.set_parent(style.default)
|
||||
style.menu_choice.set_parent(style.button_text)
|
||||
style.menu_choice.clear()
|
||||
style.menu_choice_button.set_parent(style.button)
|
||||
style.menu_choice_button.xminimum = int(config.screen_width * 0.75)
|
||||
style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Input
|
||||
#
|
||||
# Screen that's used to display renpy.input()
|
||||
# http://www.renpy.org/doc/html/screen_special.html#input
|
||||
|
||||
screen input:
|
||||
|
||||
window:
|
||||
has vbox
|
||||
|
||||
text prompt
|
||||
input id "input"
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Nvl
|
||||
#
|
||||
# Screen used for nvl-mode dialogue and menus.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#nvl
|
||||
|
||||
screen nvl:
|
||||
|
||||
window:
|
||||
style "nvl_window"
|
||||
|
||||
has vbox:
|
||||
style "nvl_vbox"
|
||||
|
||||
# Display dialogue.
|
||||
for who, what, who_id, what_id, window_id in dialogue:
|
||||
window:
|
||||
id window_id
|
||||
|
||||
has hbox:
|
||||
spacing 10
|
||||
|
||||
if who is not None:
|
||||
text who id who_id
|
||||
|
||||
text what id what_id
|
||||
|
||||
# Display a menu, if given.
|
||||
if items:
|
||||
|
||||
vbox:
|
||||
id "menu"
|
||||
|
||||
for caption, action, chosen in items:
|
||||
|
||||
if action:
|
||||
|
||||
button:
|
||||
style "nvl_menu_choice_button"
|
||||
action action
|
||||
|
||||
text caption style "nvl_menu_choice"
|
||||
|
||||
else:
|
||||
|
||||
text caption style "nvl_dialogue"
|
||||
|
||||
add SideImage() xalign 0.0 yalign 1.0
|
||||
|
||||
##############################################################################
|
||||
# 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:
|
||||
|
||||
# This ensures that any other menu screen is replaced.
|
||||
tag menu
|
||||
|
||||
# The background of the main menu.
|
||||
window:
|
||||
style "mm_root"
|
||||
|
||||
# The main menu buttons.
|
||||
frame:
|
||||
style_group "mm"
|
||||
xalign .98
|
||||
yalign .98
|
||||
|
||||
has vbox
|
||||
|
||||
textbutton _("Start Game") action Start()
|
||||
textbutton _("Music Room") action ShowMenu("music_room")
|
||||
textbutton _("Load Game") action ShowMenu("load")
|
||||
textbutton _("Preferences") action ShowMenu("preferences")
|
||||
textbutton _("Help") action Help(help='http://renpy.org/doc/html/index.html')
|
||||
textbutton _("Quit") action Quit(confirm=False)
|
||||
|
||||
if autotest:
|
||||
timer .5 action Start("autostart")
|
||||
|
||||
init -2 python:
|
||||
|
||||
# Make all the main menu buttons be the same size.
|
||||
style.mm_button.size_group = "mm"
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Navigation
|
||||
#
|
||||
# Screen that's included in other screens to display the game menu
|
||||
# navigation and background.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#navigation
|
||||
screen navigation:
|
||||
|
||||
# The background of the game menu.
|
||||
window:
|
||||
style "gm_root"
|
||||
|
||||
# The various buttons.
|
||||
frame:
|
||||
style_group "gm_nav"
|
||||
xalign .98
|
||||
yalign .98
|
||||
|
||||
has vbox
|
||||
|
||||
textbutton _("Return") action Return()
|
||||
textbutton _("Preferences") action ShowMenu("preferences")
|
||||
textbutton _("Save Game") action ShowMenu("save")
|
||||
textbutton _("Load Game") action ShowMenu("load")
|
||||
textbutton _("Main Menu") action MainMenu()
|
||||
textbutton _("Help") action Help()
|
||||
textbutton _("Quit") action Quit()
|
||||
|
||||
init -2 python:
|
||||
style.gm_nav_button.size_group = "gm_nav"
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Save, Load
|
||||
#
|
||||
# Screens that allow the user to save and load the game.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#save
|
||||
# http://www.renpy.org/doc/html/screen_special.html#load
|
||||
|
||||
# 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:
|
||||
|
||||
frame:
|
||||
style "file_picker_frame"
|
||||
|
||||
has vbox
|
||||
|
||||
# The buttons at the top allow the user to pick a
|
||||
# page of files.
|
||||
hbox:
|
||||
style_group "file_picker_nav"
|
||||
|
||||
textbutton _("Previous"):
|
||||
action FilePagePrevious()
|
||||
|
||||
textbutton _("Auto"):
|
||||
action FilePage("auto")
|
||||
|
||||
for i in range(1, 9):
|
||||
textbutton str(i):
|
||||
action FilePage(i)
|
||||
|
||||
textbutton _("Next"):
|
||||
action FilePageNext()
|
||||
|
||||
$ columns = 2
|
||||
$ rows = 5
|
||||
|
||||
# Display a grid of file slots.
|
||||
grid columns rows:
|
||||
transpose True
|
||||
xfill True
|
||||
style_group "file_picker"
|
||||
|
||||
# Display ten file slots, numbered 1 - 10.
|
||||
for i in range(1, columns * rows + 1):
|
||||
|
||||
# Each file slot is a button.
|
||||
button:
|
||||
action FileAction(i)
|
||||
xfill True
|
||||
|
||||
has hbox
|
||||
|
||||
# Add the screenshot.
|
||||
add FileScreenshot(i)
|
||||
|
||||
# Format the description, and add it as text.
|
||||
$ description = "% 2s. %s\n%s" % (
|
||||
FileSlotName(i, columns * rows),
|
||||
FileTime(i, empty=_("Empty Slot.")),
|
||||
FileSaveName(i))
|
||||
|
||||
text description
|
||||
|
||||
key "save_delete" action FileDelete(i)
|
||||
|
||||
|
||||
screen save:
|
||||
|
||||
# This ensures that any other menu screen is replaced.
|
||||
tag menu
|
||||
|
||||
use navigation
|
||||
use file_picker
|
||||
|
||||
screen load:
|
||||
|
||||
# This ensures that any other menu screen is replaced.
|
||||
tag menu
|
||||
|
||||
use navigation
|
||||
use file_picker
|
||||
|
||||
init -2 python:
|
||||
style.file_picker_frame = Style(style.menu_frame)
|
||||
|
||||
style.file_picker_nav_button = Style(style.small_button)
|
||||
style.file_picker_nav_button_text = Style(style.small_button_text)
|
||||
|
||||
style.file_picker_button = Style(style.large_button)
|
||||
style.file_picker_text = Style(style.large_button_text)
|
||||
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Preferences
|
||||
#
|
||||
# Screen that allows the user to change the preferences.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#prefereces
|
||||
|
||||
screen preferences:
|
||||
|
||||
tag menu
|
||||
|
||||
# Include the navigation.
|
||||
use navigation
|
||||
|
||||
# Put the navigation columns in a three-wide grid.
|
||||
grid 3 1:
|
||||
style_group "prefs"
|
||||
xfill True
|
||||
|
||||
# The left column.
|
||||
vbox:
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Display")
|
||||
textbutton _("Window") action Preference("display", "window")
|
||||
textbutton _("Fullscreen") action Preference("display", "fullscreen")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Transitions")
|
||||
textbutton _("All") action Preference("transitions", "all")
|
||||
textbutton _("None") action Preference("transitions", "none")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Text Speed")
|
||||
bar value Preference("text speed")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
textbutton _("Joystick...") action ShowMenu("joystick_preferences")
|
||||
|
||||
vbox:
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Skip")
|
||||
textbutton _("Seen Messages") action Preference("skip", "seen")
|
||||
textbutton _("All Messages") action Preference("skip", "all")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
textbutton _("Begin Skipping") action Skip()
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("After Choices")
|
||||
textbutton _("Stop Skipping") action Preference("after choices", "stop")
|
||||
textbutton _("Keep Skipping") action Preference("after choices", "skip")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Auto-Forward Time")
|
||||
bar value Preference("auto-forward time")
|
||||
|
||||
vbox:
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Music Volume")
|
||||
bar value Preference("music volume")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Sound Volume")
|
||||
bar value Preference("sound volume")
|
||||
|
||||
if config.sample_sound:
|
||||
textbutton "Test":
|
||||
action Play("sound", config.sample_sound)
|
||||
style "soundtest_button"
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Voice Volume")
|
||||
bar value Preference("voice volume")
|
||||
|
||||
if config.sample_voice:
|
||||
textbutton "Test":
|
||||
action Play("voice", config.sample_voice)
|
||||
style "soundtest_button"
|
||||
|
||||
init -2 python:
|
||||
style.pref_frame.xfill = True
|
||||
style.pref_frame.xmargin = 5
|
||||
style.pref_frame.top_margin = 5
|
||||
|
||||
style.pref_vbox.xfill = True
|
||||
|
||||
style.pref_button.size_group = "pref"
|
||||
style.pref_button.xalign = 1.0
|
||||
|
||||
style.pref_slider.xmaximum = 192
|
||||
style.pref_slider.xalign = 1.0
|
||||
|
||||
style.soundtest_button.xalign = 1.0
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Yes/No Prompt
|
||||
#
|
||||
# Screen that asks the user a yes or no question.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#yesno-prompt
|
||||
|
||||
screen yesno_prompt:
|
||||
|
||||
modal True
|
||||
|
||||
window:
|
||||
style "gm_root"
|
||||
|
||||
frame:
|
||||
style_group "yesno"
|
||||
|
||||
xfill True
|
||||
xmargin .05
|
||||
ypos .1
|
||||
yanchor 0
|
||||
ypadding .05
|
||||
|
||||
has vbox:
|
||||
xalign .5
|
||||
yalign .5
|
||||
spacing 30
|
||||
|
||||
label _(message):
|
||||
xalign 0.5
|
||||
|
||||
hbox:
|
||||
xalign 0.5
|
||||
spacing 100
|
||||
|
||||
textbutton _("Yes") action yes_action
|
||||
textbutton _("No") action no_action
|
||||
|
||||
|
||||
init -2 python:
|
||||
style.yesno_button.size_group = "yesno"
|
||||
style.yesno_label_text.text_align = 0.5
|
||||
# This file is in the public domain. Feel free to modify it as a basis
|
||||
# for your own screens.
|
||||
|
||||
##############################################################################
|
||||
# Say
|
||||
#
|
||||
# Screen that's used to display adv-mode dialogue.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#say
|
||||
|
||||
screen say:
|
||||
|
||||
# Defaults for side_image and two_window
|
||||
default side_image = None
|
||||
default two_window = False
|
||||
|
||||
# Decide if we want to use the one-window or two-window varaint.
|
||||
if not two_window:
|
||||
|
||||
# The one window variant.
|
||||
window:
|
||||
id "window"
|
||||
|
||||
has vbox:
|
||||
style "say_vbox"
|
||||
|
||||
if who:
|
||||
text who id "who"
|
||||
|
||||
text what id "what"
|
||||
|
||||
else:
|
||||
|
||||
# The two window variant.
|
||||
vbox:
|
||||
style "say_two_window_vbox"
|
||||
|
||||
if who:
|
||||
window:
|
||||
style "say_who_window"
|
||||
|
||||
text who:
|
||||
id "who"
|
||||
|
||||
window:
|
||||
id "window"
|
||||
|
||||
has vbox:
|
||||
style "say_vbox"
|
||||
|
||||
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
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Choice
|
||||
#
|
||||
# Screen that's used to display in-game menus.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#choice
|
||||
|
||||
screen choice:
|
||||
|
||||
window:
|
||||
style "menu_window"
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
|
||||
vbox:
|
||||
style "menu"
|
||||
spacing 2
|
||||
|
||||
for caption, action, chosen in items:
|
||||
|
||||
if action:
|
||||
|
||||
button:
|
||||
action action
|
||||
style "menu_choice_button"
|
||||
|
||||
text caption style "menu_choice"
|
||||
|
||||
else:
|
||||
text caption style "menu_caption"
|
||||
|
||||
init -2 python:
|
||||
config.narrator_menu = True
|
||||
|
||||
style.menu_window.set_parent(style.default)
|
||||
style.menu_choice.set_parent(style.button_text)
|
||||
style.menu_choice.clear()
|
||||
style.menu_choice_button.set_parent(style.button)
|
||||
style.menu_choice_button.xminimum = int(config.screen_width * 0.75)
|
||||
style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Input
|
||||
#
|
||||
# Screen that's used to display renpy.input()
|
||||
# http://www.renpy.org/doc/html/screen_special.html#input
|
||||
|
||||
screen input:
|
||||
|
||||
window:
|
||||
has vbox
|
||||
|
||||
text prompt
|
||||
input id "input"
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Nvl
|
||||
#
|
||||
# Screen used for nvl-mode dialogue and menus.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#nvl
|
||||
|
||||
screen nvl:
|
||||
|
||||
window:
|
||||
style "nvl_window"
|
||||
|
||||
has vbox:
|
||||
style "nvl_vbox"
|
||||
|
||||
# Display dialogue.
|
||||
for who, what, who_id, what_id, window_id in dialogue:
|
||||
window:
|
||||
id window_id
|
||||
|
||||
has hbox:
|
||||
spacing 10
|
||||
|
||||
if who is not None:
|
||||
text who id who_id
|
||||
|
||||
text what id what_id
|
||||
|
||||
# Display a menu, if given.
|
||||
if items:
|
||||
|
||||
vbox:
|
||||
id "menu"
|
||||
|
||||
for caption, action, chosen in items:
|
||||
|
||||
if action:
|
||||
|
||||
button:
|
||||
style "nvl_menu_choice_button"
|
||||
action action
|
||||
|
||||
text caption style "nvl_menu_choice"
|
||||
|
||||
else:
|
||||
|
||||
text caption style "nvl_dialogue"
|
||||
|
||||
add SideImage() xalign 0.0 yalign 1.0
|
||||
|
||||
##############################################################################
|
||||
# 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:
|
||||
|
||||
# This ensures that any other menu screen is replaced.
|
||||
tag menu
|
||||
|
||||
# The background of the main menu.
|
||||
window:
|
||||
style "mm_root"
|
||||
|
||||
# The main menu buttons.
|
||||
frame:
|
||||
style_group "mm"
|
||||
xalign .98
|
||||
yalign .98
|
||||
|
||||
has vbox
|
||||
|
||||
textbutton _("Start Game") action Start()
|
||||
textbutton _("Music Room") action ShowMenu("music_room")
|
||||
textbutton _("Load Game") action ShowMenu("load")
|
||||
textbutton _("Preferences") action ShowMenu("preferences")
|
||||
textbutton _("Help") action Help(help='http://renpy.org/doc/html/index.html')
|
||||
textbutton _("Quit") action Quit(confirm=False)
|
||||
|
||||
if autotest:
|
||||
timer .5 action Start("autostart")
|
||||
|
||||
init -2 python:
|
||||
|
||||
# Make all the main menu buttons be the same size.
|
||||
style.mm_button.size_group = "mm"
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Navigation
|
||||
#
|
||||
# Screen that's included in other screens to display the game menu
|
||||
# navigation and background.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#navigation
|
||||
screen navigation:
|
||||
|
||||
# The background of the game menu.
|
||||
window:
|
||||
style "gm_root"
|
||||
|
||||
# The various buttons.
|
||||
frame:
|
||||
style_group "gm_nav"
|
||||
xalign .98
|
||||
yalign .98
|
||||
|
||||
has vbox
|
||||
|
||||
textbutton _("Return") action Return()
|
||||
textbutton _("Preferences") action ShowMenu("preferences")
|
||||
textbutton _("Save Game") action ShowMenu("save")
|
||||
textbutton _("Load Game") action ShowMenu("load")
|
||||
textbutton _("Main Menu") action MainMenu()
|
||||
textbutton _("Help") action Help()
|
||||
textbutton _("Quit") action Quit()
|
||||
|
||||
init -2 python:
|
||||
style.gm_nav_button.size_group = "gm_nav"
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Save, Load
|
||||
#
|
||||
# Screens that allow the user to save and load the game.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#save
|
||||
# http://www.renpy.org/doc/html/screen_special.html#load
|
||||
|
||||
# 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:
|
||||
|
||||
frame:
|
||||
style "file_picker_frame"
|
||||
|
||||
has vbox
|
||||
|
||||
# The buttons at the top allow the user to pick a
|
||||
# page of files.
|
||||
hbox:
|
||||
style_group "file_picker_nav"
|
||||
|
||||
textbutton _("Previous"):
|
||||
action FilePagePrevious()
|
||||
|
||||
textbutton _("Auto"):
|
||||
action FilePage("auto")
|
||||
|
||||
for i in range(1, 9):
|
||||
textbutton str(i):
|
||||
action FilePage(i)
|
||||
|
||||
textbutton _("Next"):
|
||||
action FilePageNext()
|
||||
|
||||
$ columns = 2
|
||||
$ rows = 5
|
||||
|
||||
# Display a grid of file slots.
|
||||
grid columns rows:
|
||||
transpose True
|
||||
xfill True
|
||||
style_group "file_picker"
|
||||
|
||||
# Display ten file slots, numbered 1 - 10.
|
||||
for i in range(1, columns * rows + 1):
|
||||
|
||||
# Each file slot is a button.
|
||||
button:
|
||||
action FileAction(i)
|
||||
xfill True
|
||||
|
||||
has hbox
|
||||
|
||||
# Add the screenshot.
|
||||
add FileScreenshot(i)
|
||||
|
||||
# Format the description, and add it as text.
|
||||
$ description = "% 2s. %s\n%s" % (
|
||||
FileSlotName(i, columns * rows),
|
||||
FileTime(i, empty=_("Empty Slot.")),
|
||||
FileSaveName(i))
|
||||
|
||||
text description
|
||||
|
||||
key "save_delete" action FileDelete(i)
|
||||
|
||||
|
||||
screen save:
|
||||
|
||||
# This ensures that any other menu screen is replaced.
|
||||
tag menu
|
||||
|
||||
use navigation
|
||||
use file_picker
|
||||
|
||||
screen load:
|
||||
|
||||
# This ensures that any other menu screen is replaced.
|
||||
tag menu
|
||||
|
||||
use navigation
|
||||
use file_picker
|
||||
|
||||
init -2 python:
|
||||
style.file_picker_frame = Style(style.menu_frame)
|
||||
|
||||
style.file_picker_nav_button = Style(style.small_button)
|
||||
style.file_picker_nav_button_text = Style(style.small_button_text)
|
||||
|
||||
style.file_picker_button = Style(style.large_button)
|
||||
style.file_picker_text = Style(style.large_button_text)
|
||||
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Preferences
|
||||
#
|
||||
# Screen that allows the user to change the preferences.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#prefereces
|
||||
|
||||
screen preferences:
|
||||
|
||||
tag menu
|
||||
|
||||
# Include the navigation.
|
||||
use navigation
|
||||
|
||||
# Put the navigation columns in a three-wide grid.
|
||||
grid 3 1:
|
||||
style_group "prefs"
|
||||
xfill True
|
||||
|
||||
# The left column.
|
||||
vbox:
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Display")
|
||||
textbutton _("Window") action Preference("display", "window")
|
||||
textbutton _("Fullscreen") action Preference("display", "fullscreen")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Transitions")
|
||||
textbutton _("All") action Preference("transitions", "all")
|
||||
textbutton _("None") action Preference("transitions", "none")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Text Speed")
|
||||
bar value Preference("text speed")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
textbutton _("Joystick...") action ShowMenu("joystick_preferences")
|
||||
|
||||
vbox:
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Skip")
|
||||
textbutton _("Seen Messages") action Preference("skip", "seen")
|
||||
textbutton _("All Messages") action Preference("skip", "all")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
textbutton _("Begin Skipping") action Skip()
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("After Choices")
|
||||
textbutton _("Stop Skipping") action Preference("after choices", "stop")
|
||||
textbutton _("Keep Skipping") action Preference("after choices", "skip")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Auto-Forward Time")
|
||||
bar value Preference("auto-forward time")
|
||||
|
||||
vbox:
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Music Volume")
|
||||
bar value Preference("music volume")
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Sound Volume")
|
||||
bar value Preference("sound volume")
|
||||
|
||||
if config.sample_sound:
|
||||
textbutton "Test":
|
||||
action Play("sound", config.sample_sound)
|
||||
style "soundtest_button"
|
||||
|
||||
frame:
|
||||
style_group "pref"
|
||||
has vbox
|
||||
|
||||
label _("Voice Volume")
|
||||
bar value Preference("voice volume")
|
||||
|
||||
if config.sample_voice:
|
||||
textbutton "Test":
|
||||
action Play("voice", config.sample_voice)
|
||||
style "soundtest_button"
|
||||
|
||||
init -2 python:
|
||||
style.pref_frame.xfill = True
|
||||
style.pref_frame.xmargin = 5
|
||||
style.pref_frame.top_margin = 5
|
||||
|
||||
style.pref_vbox.xfill = True
|
||||
|
||||
style.pref_button.size_group = "pref"
|
||||
style.pref_button.xalign = 1.0
|
||||
|
||||
style.pref_slider.xmaximum = 192
|
||||
style.pref_slider.xalign = 1.0
|
||||
|
||||
style.soundtest_button.xalign = 1.0
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Yes/No Prompt
|
||||
#
|
||||
# Screen that asks the user a yes or no question.
|
||||
# http://www.renpy.org/doc/html/screen_special.html#yesno-prompt
|
||||
|
||||
screen yesno_prompt:
|
||||
|
||||
modal True
|
||||
|
||||
window:
|
||||
style "gm_root"
|
||||
|
||||
frame:
|
||||
style_group "yesno"
|
||||
|
||||
xfill True
|
||||
xmargin .05
|
||||
ypos .1
|
||||
yanchor 0
|
||||
ypadding .05
|
||||
|
||||
has vbox:
|
||||
xalign .5
|
||||
yalign .5
|
||||
spacing 30
|
||||
|
||||
label _(message):
|
||||
xalign 0.5
|
||||
|
||||
hbox:
|
||||
xalign 0.5
|
||||
spacing 100
|
||||
|
||||
textbutton _("Yes") action yes_action
|
||||
textbutton _("No") action no_action
|
||||
|
||||
|
||||
init -2 python:
|
||||
style.yesno_button.size_group = "yesno"
|
||||
style.yesno_label_text.textalign = 0.5
|
||||
|
||||
+248
-248
@@ -1,248 +1,248 @@
|
||||
init python:
|
||||
import os
|
||||
|
||||
autotest = False
|
||||
|
||||
|
||||
def auto_command():
|
||||
ap = renpy.arguments.ArgumentParser()
|
||||
args = ap.parse_args()
|
||||
|
||||
global autotest
|
||||
|
||||
autotest = True
|
||||
config.auto_choice_delay = 0.5
|
||||
_preferences.afm_time = 0.5
|
||||
_preferences.afm_enable = True
|
||||
|
||||
os.environ["RENPY_SIMPLE_EXCEPTIONS"] = "1"
|
||||
|
||||
return True
|
||||
|
||||
renpy.arguments.register_command("auto", auto_command)
|
||||
|
||||
JAPANESE = "../../sdk-fonts/SourceHanSansLite.ttf"
|
||||
|
||||
image eileen happy = "eileen_happy.png"
|
||||
image eileen vhappy = "eileen_vhappy.png"
|
||||
image eileen concerned = "eileen_concerned.png"
|
||||
|
||||
###############################################################################
|
||||
# Welcome
|
||||
###############################################################################
|
||||
|
||||
label autostart:
|
||||
call text
|
||||
call get_image_bounds
|
||||
$ renpy.quit()
|
||||
|
||||
label start:
|
||||
|
||||
"Welcome to the Ren'Py test cases. This is meant for automatic consumption, so it may be weird if you're just reading this."
|
||||
|
||||
menu start_loop:
|
||||
"Choose a test case:"
|
||||
|
||||
"Text":
|
||||
call text
|
||||
|
||||
"Get Image Bounds":
|
||||
call get_image_bounds
|
||||
|
||||
"Retain after Load":
|
||||
call retain_after_load
|
||||
|
||||
"Gallery":
|
||||
call gallery
|
||||
|
||||
"Done.":
|
||||
return
|
||||
|
||||
jump start_loop
|
||||
|
||||
###############################################################################
|
||||
# Text
|
||||
###############################################################################
|
||||
|
||||
init python:
|
||||
_preferences.text_cps = 100
|
||||
|
||||
style.red = Style(style.default)
|
||||
style.red.color = "#f00"
|
||||
|
||||
style.ruby_style = Style(style.default)
|
||||
style.ruby_style.size = 12
|
||||
style.ruby_style.yoffset = -18
|
||||
|
||||
|
||||
define ruby = Character(None, what_line_leading=10, what_ruby_style=style.ruby_style)
|
||||
|
||||
# label main_menu:
|
||||
# return
|
||||
|
||||
screen vtext_test:
|
||||
fixed:
|
||||
area (0, 0, 400, 300)
|
||||
add "#000"
|
||||
fixed:
|
||||
area (400, 300, 400, 300)
|
||||
add "#000"
|
||||
|
||||
text "「可愛いね〜」と、彼女は言った。":
|
||||
vertical True
|
||||
font JAPANESE
|
||||
xpos 400 ypos 100
|
||||
xanchor 0.5
|
||||
yanchor 0.0
|
||||
|
||||
screen text1:
|
||||
frame:
|
||||
has vbox
|
||||
|
||||
text "Testing bold, color, italics, underline, and strikethrough.":
|
||||
bold True
|
||||
italic True
|
||||
underline True
|
||||
strikethrough True
|
||||
color "#000"
|
||||
|
||||
text "Testing font and size.":
|
||||
font JAPANESE
|
||||
size 30
|
||||
|
||||
text "Testing drop_shadow.":
|
||||
drop_shadow [ (2, 2) ]
|
||||
drop_shadow_color "#000"
|
||||
|
||||
text "Testing outlines.":
|
||||
outlines [ (2, "#000", 0, 0) ]
|
||||
|
||||
text "Testing changing the kerning value, with AA turned off.":
|
||||
kerning 2
|
||||
antialias False
|
||||
|
||||
null height 10
|
||||
|
||||
text "Justification: The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.":
|
||||
justify True
|
||||
|
||||
null height 10
|
||||
|
||||
text "Greedy: The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.":
|
||||
layout "greedy"
|
||||
justify True
|
||||
|
||||
null height 10
|
||||
|
||||
text "Subtitle: The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.":
|
||||
language "korean-with-spaces"
|
||||
layout "subtitle"
|
||||
xalign 0.5
|
||||
text_align 0.5
|
||||
|
||||
text "ビジュアルノベル、ヴィジュアルノベル(visual novel)とは、コンピュータゲームの一ジャンルである。ビジュアルノベルそれ自体もアドベンチャーゲームの一種に分類される。ノベルゲームやサウンドノベルと呼ばれることもある。":
|
||||
font JAPANESE
|
||||
|
||||
text "Min-width & Text_align":
|
||||
min_width 400
|
||||
text_align 1.0
|
||||
|
||||
text "This will be typed out slowly.":
|
||||
slow_cps 40
|
||||
|
||||
label text:
|
||||
|
||||
# Text tag tests.
|
||||
"{alpha=0.1}This text is barely readable!{/alpha}"
|
||||
"{alpha=-0.1}This text is 10%% more transparent than the default.{/alpha}"
|
||||
"{alpha=*0.5}This text is half as opaque as the default.{/alpha}"
|
||||
|
||||
show screen text1
|
||||
"..."
|
||||
hide screen text1
|
||||
|
||||
show screen vtext_test
|
||||
"..."
|
||||
hide screen test1
|
||||
|
||||
$ a = 42
|
||||
$ b = "{b}"
|
||||
"42 =/= [a], {{b} =/= [b!q]"
|
||||
|
||||
"This line is displayed at normal speed. {cps=200}This is displayed at faster speed.{/cps} {cps=50}This is displayed at slower speed.{/cps} {cps=*.5}This is displayed at half speed.{/cps}"
|
||||
|
||||
ruby "Testing ruby: S{rt}s{/rt}ingle, {rb}Word{/rb}{rt}word{/rt}."
|
||||
|
||||
"{k=-.5}Kerning can be adjusted by the k tag.{/k}\nKerning can be adjusted by the k tag.\n{k=.5}Kerning can be adjusted by the k tag.{/k}"
|
||||
|
||||
"Testing color {color=#f00}red{/color}, {color=#ff0f}yellow{/color}, {color=#00ff00}green{/color}, {color=#0000ffff}blue{/color}."
|
||||
|
||||
"Testing size {size=18}absolute{/size}, {size=-6}smaller{/size}, {size=+6}bigger{/size}."
|
||||
|
||||
"Testing an {font=[JAPANESE]}alternate font{/font}."
|
||||
|
||||
"Testing a {=red}custom text tag{/=red}."
|
||||
|
||||
"Testing {b}bold{/b}, {i}italics{/i}, {u}underline{/u}, and {s}strikethrough{/s}."
|
||||
"Testing {b}{i}bold italic{/i} and {plain}plain{/plain} tags.{/b}"
|
||||
|
||||
"Testing the {a=http://www.renpy.org}hyperlink{/a} tag."
|
||||
|
||||
"Testing the space{space=40}and vspace{vspace=40}tags."
|
||||
|
||||
"Testing paragraph{p}and non-paragraph {w}waits."
|
||||
"Testing paragraph{p=1}and non-paragraph {w=1}timed waits."
|
||||
"Testing the {w}fast display tag. {fast}There should not have been any waits."
|
||||
|
||||
"Testing no-wait mode{nw}"
|
||||
"No-wait mode worked."
|
||||
|
||||
return
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Get Image Bounds
|
||||
###############################################################################
|
||||
|
||||
label get_image_bounds:
|
||||
|
||||
show eileen happy at center
|
||||
|
||||
$ bounds = renpy.get_image_bounds("eileen")
|
||||
|
||||
"Eileen's bounding box: [bounds]"
|
||||
|
||||
return
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Retain on Load
|
||||
###############################################################################
|
||||
|
||||
screen retain_after_load(label):
|
||||
frame:
|
||||
has vbox
|
||||
label label
|
||||
|
||||
text "value = [value]"
|
||||
|
||||
textbutton "Increase Value" action SetVariable("value", value+1)
|
||||
textbutton "Decrease Value" action SetVariable("value", value-1)
|
||||
textbutton "Done" action Return(True)
|
||||
|
||||
label retain_after_load:
|
||||
|
||||
$ value = 1
|
||||
|
||||
"..."
|
||||
"The value is [value] (should always be 1)."
|
||||
"..."
|
||||
|
||||
$ renpy.retain_after_load()
|
||||
call screen retain_after_load("In Retain after Load Mode")
|
||||
call screen retain_after_load("Not in Retain after Load Mode")
|
||||
|
||||
return
|
||||
|
||||
|
||||
return
|
||||
init python:
|
||||
import os
|
||||
|
||||
autotest = False
|
||||
|
||||
|
||||
def auto_command():
|
||||
ap = renpy.arguments.ArgumentParser()
|
||||
args = ap.parse_args()
|
||||
|
||||
global autotest
|
||||
|
||||
autotest = True
|
||||
config.auto_choice_delay = 0.5
|
||||
_preferences.afm_time = 0.5
|
||||
_preferences.afm_enable = True
|
||||
|
||||
os.environ["RENPY_SIMPLE_EXCEPTIONS"] = "1"
|
||||
|
||||
return True
|
||||
|
||||
renpy.arguments.register_command("auto", auto_command)
|
||||
|
||||
JAPANESE = "../../sdk-fonts/SourceHanSansLite.ttf"
|
||||
|
||||
image eileen happy = "eileen_happy.png"
|
||||
image eileen vhappy = "eileen_vhappy.png"
|
||||
image eileen concerned = "eileen_concerned.png"
|
||||
|
||||
###############################################################################
|
||||
# Welcome
|
||||
###############################################################################
|
||||
|
||||
label autostart:
|
||||
call text
|
||||
call get_image_bounds
|
||||
$ renpy.quit()
|
||||
|
||||
label start:
|
||||
|
||||
"Welcome to the Ren'Py test cases. This is meant for automatic consumption, so it may be weird if you're just reading this."
|
||||
|
||||
menu start_loop:
|
||||
"Choose a test case:"
|
||||
|
||||
"Text":
|
||||
call text
|
||||
|
||||
"Get Image Bounds":
|
||||
call get_image_bounds
|
||||
|
||||
"Retain after Load":
|
||||
call retain_after_load
|
||||
|
||||
"Gallery":
|
||||
call gallery
|
||||
|
||||
"Done.":
|
||||
return
|
||||
|
||||
jump start_loop
|
||||
|
||||
###############################################################################
|
||||
# Text
|
||||
###############################################################################
|
||||
|
||||
init python:
|
||||
_preferences.text_cps = 100
|
||||
|
||||
style.red = Style(style.default)
|
||||
style.red.color = "#f00"
|
||||
|
||||
style.ruby_style = Style(style.default)
|
||||
style.ruby_style.size = 12
|
||||
style.ruby_style.yoffset = -18
|
||||
|
||||
|
||||
define ruby = Character(None, what_line_leading=10, what_ruby_style=style.ruby_style)
|
||||
|
||||
# label main_menu:
|
||||
# return
|
||||
|
||||
screen vtext_test:
|
||||
fixed:
|
||||
area (0, 0, 400, 300)
|
||||
add "#000"
|
||||
fixed:
|
||||
area (400, 300, 400, 300)
|
||||
add "#000"
|
||||
|
||||
text "「可愛いね〜」と、彼女は言った。":
|
||||
vertical True
|
||||
font JAPANESE
|
||||
xpos 400 ypos 100
|
||||
xanchor 0.5
|
||||
yanchor 0.0
|
||||
|
||||
screen text1:
|
||||
frame:
|
||||
has vbox
|
||||
|
||||
text "Testing bold, color, italics, underline, and strikethrough.":
|
||||
bold True
|
||||
italic True
|
||||
underline True
|
||||
strikethrough True
|
||||
color "#000"
|
||||
|
||||
text "Testing font and size.":
|
||||
font JAPANESE
|
||||
size 30
|
||||
|
||||
text "Testing drop_shadow.":
|
||||
drop_shadow [ (2, 2) ]
|
||||
drop_shadow_color "#000"
|
||||
|
||||
text "Testing outlines.":
|
||||
outlines [ (2, "#000", 0, 0) ]
|
||||
|
||||
text "Testing changing the kerning value, with AA turned off.":
|
||||
kerning 2
|
||||
antialias False
|
||||
|
||||
null height 10
|
||||
|
||||
text "Justification: The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.":
|
||||
justify True
|
||||
|
||||
null height 10
|
||||
|
||||
text "Greedy: The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.":
|
||||
layout "greedy"
|
||||
justify True
|
||||
|
||||
null height 10
|
||||
|
||||
text "Subtitle: The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.":
|
||||
language "korean-with-spaces"
|
||||
layout "subtitle"
|
||||
xalign 0.5
|
||||
textalign 0.5
|
||||
|
||||
text "ビジュアルノベル、ヴィジュアルノベル(visual novel)とは、コンピュータゲームの一ジャンルである。ビジュアルノベルそれ自体もアドベンチャーゲームの一種に分類される。ノベルゲームやサウンドノベルと呼ばれることもある。":
|
||||
font JAPANESE
|
||||
|
||||
text "Min-width & Textalign":
|
||||
min_width 400
|
||||
textalign 1.0
|
||||
|
||||
text "This will be typed out slowly.":
|
||||
slow_cps 40
|
||||
|
||||
label text:
|
||||
|
||||
# Text tag tests.
|
||||
"{alpha=0.1}This text is barely readable!{/alpha}"
|
||||
"{alpha=-0.1}This text is 10%% more transparent than the default.{/alpha}"
|
||||
"{alpha=*0.5}This text is half as opaque as the default.{/alpha}"
|
||||
|
||||
show screen text1
|
||||
"..."
|
||||
hide screen text1
|
||||
|
||||
show screen vtext_test
|
||||
"..."
|
||||
hide screen test1
|
||||
|
||||
$ a = 42
|
||||
$ b = "{b}"
|
||||
"42 =/= [a], {{b} =/= [b!q]"
|
||||
|
||||
"This line is displayed at normal speed. {cps=200}This is displayed at faster speed.{/cps} {cps=50}This is displayed at slower speed.{/cps} {cps=*.5}This is displayed at half speed.{/cps}"
|
||||
|
||||
ruby "Testing ruby: S{rt}s{/rt}ingle, {rb}Word{/rb}{rt}word{/rt}."
|
||||
|
||||
"{k=-.5}Kerning can be adjusted by the k tag.{/k}\nKerning can be adjusted by the k tag.\n{k=.5}Kerning can be adjusted by the k tag.{/k}"
|
||||
|
||||
"Testing color {color=#f00}red{/color}, {color=#ff0f}yellow{/color}, {color=#00ff00}green{/color}, {color=#0000ffff}blue{/color}."
|
||||
|
||||
"Testing size {size=18}absolute{/size}, {size=-6}smaller{/size}, {size=+6}bigger{/size}."
|
||||
|
||||
"Testing an {font=[JAPANESE]}alternate font{/font}."
|
||||
|
||||
"Testing a {=red}custom text tag{/=red}."
|
||||
|
||||
"Testing {b}bold{/b}, {i}italics{/i}, {u}underline{/u}, and {s}strikethrough{/s}."
|
||||
"Testing {b}{i}bold italic{/i} and {plain}plain{/plain} tags.{/b}"
|
||||
|
||||
"Testing the {a=http://www.renpy.org}hyperlink{/a} tag."
|
||||
|
||||
"Testing the space{space=40}and vspace{vspace=40}tags."
|
||||
|
||||
"Testing paragraph{p}and non-paragraph {w}waits."
|
||||
"Testing paragraph{p=1}and non-paragraph {w=1}timed waits."
|
||||
"Testing the {w}fast display tag. {fast}There should not have been any waits."
|
||||
|
||||
"Testing no-wait mode{nw}"
|
||||
"No-wait mode worked."
|
||||
|
||||
return
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Get Image Bounds
|
||||
###############################################################################
|
||||
|
||||
label get_image_bounds:
|
||||
|
||||
show eileen happy at center
|
||||
|
||||
$ bounds = renpy.get_image_bounds("eileen")
|
||||
|
||||
"Eileen's bounding box: [bounds]"
|
||||
|
||||
return
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Retain on Load
|
||||
###############################################################################
|
||||
|
||||
screen retain_after_load(label):
|
||||
frame:
|
||||
has vbox
|
||||
label label
|
||||
|
||||
text "value = [value]"
|
||||
|
||||
textbutton "Increase Value" action SetVariable("value", value+1)
|
||||
textbutton "Decrease Value" action SetVariable("value", value-1)
|
||||
textbutton "Done" action Return(True)
|
||||
|
||||
label retain_after_load:
|
||||
|
||||
$ value = 1
|
||||
|
||||
"..."
|
||||
"The value is [value] (should always be 1)."
|
||||
"..."
|
||||
|
||||
$ renpy.retain_after_load()
|
||||
call screen retain_after_load("In Retain after Load Mode")
|
||||
call screen retain_after_load("Not in Retain after Load Mode")
|
||||
|
||||
return
|
||||
|
||||
|
||||
return
|
||||
|
||||
+1530
-1530
File diff suppressed because it is too large
Load Diff
@@ -546,7 +546,7 @@ screen example(blocks, small=False, bottom=False, showtrans=False):
|
||||
textbutton _("copy"):
|
||||
style "empty"
|
||||
text_style "quick_button_text"
|
||||
text_text_align 0.5
|
||||
text_textalign 0.5
|
||||
text_minwidth 180
|
||||
|
||||
text_size 16
|
||||
|
||||
+1094
-1096
File diff suppressed because it is too large
Load Diff
+1506
-1506
File diff suppressed because it is too large
Load Diff
+662
-662
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user