Skip to content

Commit

Permalink
feat(examples): add dialogue
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Aug 26, 2024
1 parent ac5cb28 commit a20a863
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion game/examples/characters.rpy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Declare characters used by this game. The color argument colorizes the
# name of the character.

define e = Character("Eileen")
define e = Character("Eileen", image="eileen")
32 changes: 32 additions & 0 deletions game/examples/dialogue.rpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# https://www.renpy.org/doc/html/dialogue.html
label dialogue:

# The say statement is used for dialogue and narration.
"This is narration."

"Eileen" "This is dialogue, with an explicit character name."

e "This is dialogue, using a character object instead."

"Bam!!" with vpunch

# Certain characters have special meaning to Ren'Py, and so can't be used in dialogue strings. The { character begins a text tag, and the [ character begins a substitution. To use them in dialogue, double them. It may also be necessary to precede a quote with a backslash to prevent it from closing the string.
"I walked past a sign saying, \"Let's give it 100%%!\""

# When a character is defined with an associated image tag, say statement involving that character may have image attributes placed between the character name and the second string.
show eileen
e concerned "I'm a little upset at you."

# When an @ is included in the list of attributes, any element placed after it has an only temporary effect, and is reverted at the end of the line of dialogue.
e @ happy "That's funny."

e -happy "I'm not sure what to think now."

# A single line can combine permanent changes coming before the @, and temporary ones coming after.
e happy @ vhappy "Really! That changes everything."

# The minus sign can also be used after the @ sign
e @ happy -concerned "My anger is temporarily suspended..."
e "HOWEVER !"

jump start
3 changes: 3 additions & 0 deletions game/examples/start.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ label start:
menu:
"Which example do you want to see?"

"Dialogue":
jump dialogue

"Text":
jump text

Expand Down
6 changes: 0 additions & 6 deletions game/examples/text.rpy
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
label text:

# This shows a character sprite. A placeholder is used, but you can
# replace it by adding a file named "eileen happy.png" to the images
# directory.

show eileen happy

# These display lines of dialogue.

e "You've created a new Ren'Py game."
Expand Down

0 comments on commit a20a863

Please sign in to comment.