Skip to content

Commit 72e9763

Browse files
feat(examples): add more dialogue and text
1 parent a20a863 commit 72e9763

File tree

2 files changed

+104
-3
lines changed

2 files changed

+104
-3
lines changed

game/examples/dialogue.rpy

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,34 @@ label dialogue:
2929
e @ happy -concerned "My anger is temporarily suspended..."
3030
e "HOWEVER !"
3131

32+
# Automatically changes the expression when the first line is finished showing. This only makes sense when the user doesn't have text speed set all the way up.
33+
show eileen concerned
34+
e "Sometimes, I feel sad.{nw}"
35+
show eileen happy
36+
extend " But I usually quickly get over it!"
37+
38+
window show # shows the window with the default transition, if any.
39+
pause # the window is shown during this pause.
40+
window hide # hides the window.
41+
pause # the window is hidden during this pause.
42+
43+
# Ren'Py supports monologue mode. When dialogue is inside triple-quoted strings, Ren'Py will break the dialogue up into blocks at blank lines. Each block is then used to create its own say statement.
44+
"""
45+
This is the first line of narration. It's longer than the other two
46+
lines, so it has to wrap.
47+
48+
This is the second line of narration.
49+
50+
This is the third line of narration.
51+
"""
52+
53+
e """
54+
This is the first line of dialogue. It's longer than the other two
55+
lines, so it has to wrap.
56+
57+
This is the second line of dialogue.
58+
59+
This is the third line of dialogue.
60+
"""
61+
3262
jump start

game/examples/text.rpy

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,80 @@
11
label text:
22

3-
# These display lines of dialogue.
3+
# Additional arguments can be passed to the say statement by including them in parenthesis after the say statement.
4+
e "Hello, world." (what_color="#8c8")
45

5-
e "You've created a new Ren'Py game."
6+
# Ren'Py supports interpolating data into the text string before it is displayed.
7+
default playername = "Guy"
8+
"Welcome to the Nekomimi Institute, [playername]!"
69

7-
e "Once you add a story, pictures, and music, you can release it to the world!"
10+
# It can also interpolate any valid Python expression.
11+
$ names = ["John", "Mary"]
12+
"My first name is [names[0]]."
13+
14+
# It's possible to apply formatting when displaying numbers.
15+
$ points = 42
16+
$ max_points = 100
17+
"I like you [100.0 * points / max_points:.2] percent!"
18+
19+
# Text tags are suitable for styling a portion of text block.
20+
"Plain {b}Bold {i}Bold-Italic{/i} Bold{/b} Plain"
21+
22+
# Ren'Py will close all tags that are open at the end of the text block.
23+
"{size=+20}This is big!"
24+
25+
# The anchor tag creates a hyperlink between itself and its closing tag.
26+
"Why don't you visit {a=https://renpy.org}Ren'Py's home page{/a}?"
27+
"Or {a=jump:more_text}here for more info{/a}."
28+
29+
jump start
30+
31+
label more_text:
32+
33+
# The alpha text tag renders the text between itself and its closing tag in the specified opacity. The opacity should be a value between 0.0 and 1.0, corresponding to fully invisible and fully opaque, respectively. If the value is prefixed by + or -, the opacity will be changed by that amount instead of completely replaced. If the value is prefixed by *, the opacity will be multiplied by that amount.
34+
"{alpha=0.1}This text is barely readable!{/alpha}"
35+
"{alpha=-0.1}This text is 10 percent more transparent than the default.{/alpha}"
36+
"{alpha=*0.5}This text is half as opaque as the default.{/alpha}"
37+
38+
# The color text tag renders the text between itself and its closing tag in the specified color. The color should be in #rgb, #rgba, #rrggbb, or #rrggbbaa format.
39+
"{color=#f00}Red{/color}, {color=#00ff00}Green{/color}, {color=#0000ffff}Blue{/color}"
40+
41+
# The characters per second tag sets the speed of text display, for text between the tag and its closing tag. If the argument begins with an asterisk, it's taken as a multiplier to the current text speed. Otherwise, the argument gives the speed to show the text at, in characters per second.
42+
"{cps=20}Fixed Speed{/cps} {cps=*2}Double Speed{/cps}"
43+
44+
# The strikethrough tag draws a line through text between itself and its closing tag.
45+
"It's good {s}to see you{/s}."
46+
47+
# The space tag is a self-closing tag that inserts horizontal space into a line of text.
48+
"Before the space.{space=30}After the space."
49+
50+
# The underline tag underlines the text between itself and its closing tag.
51+
"It's good to {u}see{/u} you."
52+
53+
# The vspace tag is a self-closing tag that inserts vertical space between lines of text.
54+
"Line 1{vspace=30}Line 2"
55+
56+
# The wait tag is a self-closing tag that waits for the user to click to continue.
57+
"Line 1{w} Line 1{w=1.0} Line 1"
58+
59+
# The paragraph pause tag is a self-closing tag that terminates the current paragraph, and waits for the user to click to continue.
60+
"Line 1{p}Line 2{p=1.0}Line 3"
61+
62+
# The no-wait tag is a self-closing tag that causes the current line of dialogue to automatically dismiss itself once the end of line has been displayed.
63+
"Looks like they're{nw}"
64+
65+
# If the fast tag is displayed in a line of text, then all text before it is displayed instantly, even in slow text mode.
66+
"Looks like they're{fast} playing with their trebuchet again."
67+
68+
# Text can also be used as a displayable, which allows you to apply transforms to text, displaying it as if it was an image and moving it around the screen.
69+
show text "{size=50}{color=#f00}Hello, World" at truecenter
70+
with dissolve
71+
pause 5
72+
hide text
73+
with dissolve
74+
75+
# You can use ParameterizedText directly to define similar images with different style properties.
76+
image top_text = ParameterizedText(xalign=0.5, yalign=0.0)
77+
show top_text "{size=50}{color=#f00}This text is shown at the center-top of the screen"
78+
pause 5
879

980
jump start

0 commit comments

Comments
 (0)