|
1 | 1 | label text:
|
2 | 2 |
|
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") |
4 | 5 |
|
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]!" |
6 | 9 |
|
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 |
8 | 79 |
|
9 | 80 | jump start
|
0 commit comments