Ren’py 7.3.0 «the world (wide web) is not enough.»

Menu and String Translations link

In addition to dialogue, Ren’Py is able to translate text found in
menus and other strings. Interface translations are a 1-to-1
substitution. Wherever a string is found, it will be replaced by a
single replacement.

When generating translations, Ren’Py will scan the script files for
menus, and for strings enclosed inside the function. It will then
place the strings inside a block. For example, if we
have the following script:

define e = Character(_("Eileen"))

# ...

menu

     "Go West"
        # ...

     "Head East"
        # ...

Ren’Py will generate:

translate piglatin strings

    old "Eileen"
    new ""

    old "Go West"
    new ""

    old "Head East"
    new ""

Which can then be translated:

translate piglatin strings

    old "Eileen"
    new "Eileenway"

    old "Go West"
    new "Ogay Estway"

    old "Head East"
    new "Eadhay Eastway"

String translations are also applied to dialogue strings that are not
translated as dialogue.

When the same string is used in multiple places, the string can
be distinguished using the {#…} text tag. Even though they display the
same, Ren’Py considers all of these distinct strings for the purpose
of translation:

"New"
"New{#project}"
"New{#game}"
"New{#playlist}"

The statement can also be used to translate the None
language. This can be used to when the game is written in a non-English
language, to translate the Ren’Py user interface.

translate None strings
     old "Start Game"
     new "Artstay Amegay"

Translating Substitutions

String substitutions can be translated using the conversion
flag. So the following will be translatable using a combination of
the dialogue and string translation systems:

if mood_points > 5
    $ mood = _("great")
else
    $ mood = _("awful")

"I'm feeling ."

Announcement

I’d like to announce Ren’Py 7.4.8, the ninth patch release of Ren’Py
7.4. The largest amount of work was done to update the Android version
of Ren’Py to keep pace with Google Play’s requirements. Ren’Py now
uses the Android App Bundle format, and uses Play Asset Delivery
to download assets to the player’s device.

In addition to the Android improvements, some of the major changes are:

  • Improvements to the web updater, providing a less efficient mode
    that works with https web servers.
  • A new option in the launcher that can tell you if a new Ren’Py release
    exists.
  • Improvements to the 3D stage, so that the camera statement and perspective
    work with transitions and transforms.
  • Transforms now can take fractional sizes.
  • The shift+A accessibility menu now has a new high-contrast mode, to make
    text more readable.

These are just some of the improvements in this release, so please read
the changelog to find everything new.

Ren’Py 7.4 is brought to you by:

  • Andrej
  • Andrí Wilford
  • Andy_kl
  • Capntrips
  • Cherie Davidson
  • CobaltCore
  • CodePsy
  • Daniel Conley
  • Daniel Luque
  • Dogtopus
  • Eric Ahn
  • GimmiRuski
  • GiovanH
  • Gouvernathor
  • Gratusfr
  • Hyper Sonic
  • Jackmcbarn
  • Jan Masek
  • Joaquin Garmendia Cabrera
  • Joshua Fehler
  • Joshua Stone
  • Kapil Gain
  • KG
  • Kyouryuukunn
  • Lee Yunseok
  • Lent1
  • Lezalith
  • Lucas Ramage
  • Maciej Katafiasz
  • Mal Graty
  • Mason Chou
  • Maxwell Paul Brickner
  • Midgethetree
  • Moshibit
  • Neotus
  • Paul J Martinez
  • Remix
  • Ruben Jesus Garcia-Hernandez
  • Siege-Wizard
  • Shawna-p
  • Sylvain Beucler
  • Uyjulian
  • Xavimat
  • Zedraxlo
  • 被诅咒的章鱼
  • 逆转咸鱼

everyone who’s tested this release, and myself, Tom «PyTom» Rothamel.

Downloads of Ren’Py 7.4.9 can be found at:

A full list of changes to Ren’Py can be found at:

A list of changes that may require you to update your game can be found at:

Call Statement link

The call statement is used to transfer control to the given label. It
also pushes the next statement onto the call stack, allowing the return statement
to return control to the statement following the call.

If the keyword is present, the expression following it is evaluated, and the
string so computed is used as the name of the label to call. If the
keyword is not present, the name of the statement to call must be
explicitly given.

If the optional clause is present, it has the effect of including a label
statement with the given name as the statement immediately following the call
statement. An explicit label helps to ensure that saved games with return
stacks can return to the proper place when loaded on a changed script.

label start

    e "First, we will call a subroutine."

    call subroutine

    call subroutine(2)

    call expression "sub" + "routine" pass (count=3)

    return

# ...

label subroutine(count=1):

    e "I came here  time(s)."
    e "Next, we will return from the subroutine."

    return

The call statement may take arguments, which are processed as described in PEP 3102.

Characters link

One problem with the first example is that it requires you to
repeatedly type the name of a character each time they speak. In a
dialogue-heavy game, this might be a lot of typing. Also, both
character names are displayed in the same way, in the accent color
selected when starting the game. To fix this, Ren’Py lets you define
characters in advance. This lets you associate a short name with a
character, and to change the color of the character’s name.

define s = Character('Sylvie', color="#c8ffc8")
define m = Character('Me', color="#c8c8ff")

label start

    s "Hi there! How was class?"

    m "Good..."

    "I can't bring myself to admit that it all went in one ear and out the other."

    s "Are you going home now? Wanna walk back with me?"

    m "Sure!"

The first and and second lines define characters. The first line
defines a character with the short name of «s», the long name
«Sylvie», with a name that is shown in a greenish color. (The colors
are red-green-blue hex triples, as used in web pages.)

The second line creates a character with a short name «m», a long name
«Me», with the name shown in a reddish color. Other characters can be
defined by copying one of the character lines, and changing the short
name, long name, and color.

Logical Lines link

A script file is broken up into logical lines. A logical line
always begins at the start of a line in the file. A logical line ends
at the end of a line, unless:

  • The last character on the line is a backslash (‘\’).
  • The line contains an open parenthesis character (‘(‘, ‘{‘, or », respectively).
  • The end of the line occurs during a string.

Once a logical line ends, the next logical line begins at the start of
the next line.

Most statements in the Ren’Py language consist of a single logical
line, while some statements consist of multiple lines.

"This is one logical line"

"Since this line contains a string, it continues
 even when the line ends."

$ a =  "Because of parenthesis, this line also",
        "spans more than one line." 

Hide Statement link

The statement removes an image from a layer. It consists of the
keyword , followed by an image name, followed by an optional
property. The hide statement takes the image tag from the image name,
and then hides any image on the layer with that tag.

Hide statements are rarely necessary. If a sprite represents a
character, then a hide statement is only necessary when the character
leaves the scene. When the character changes her emotion, it is
preferable to use the show statement instead, as the show statement
will automatically replace an image with the same tag.

The hide statement takes the following property:

Takes a name. Hides the image from the named layer.

For example:

e "I'm out of here."

hide eileen

You should never write:

hide eileen
show eileen happy

Instead, just write:

Additional Downloads

Raspberry Pi Support: renpy-7.1.1-raspi.tar.bz2
Contains files required to allow Ren’Py to run on the Raspberry Pi. This should be untarred in the Ren’Py sdk directory.
Ren’Py Source Code: renpy-7.1.1-source.tar.bz2
Contains the source code of the Ren’Py distribution without any binary components.
Pygame_SDL2 Source Code: pygame_sdl2-2.1.0-for-renpy-7.1.1.tar.gz
Contains the source code for the version of pygame_sdl2 required to run this version of Ren’Py. This may be newer than any released version of pygame_sdl2.
Other Dependencies: https://www.renpy.org/doc/html/license.html
Ren’Py contains free software licensed under a number of licenses, including the GNU Lesser
General Public License. A full list of software and links to git repositories from which the software
can be downloaded is linked above.
Checksums: checksums.txt
Checksums for the various files making up the Ren’Py distribution.

We also maintain a complete list of releases.

Concepts link

Image

An image is something that can be show to the screen using the show
statement. An image consists of a name and a displayable. When the
image is shown on a layer, the displayable associated with it is
displayed on that layer.

An image name consists of one or more names, separated by
spaces. The first component of the image name is called the image
tag. The second and later components of the name are the image
attributes.

For example, take the image name . The image
tag is , while the image attributes are , ,
and .

A displayable is something that can be shown on the screen. The most
common thing to show is a static image, which can be specified by
giving the filename of the image, as a string. In the example above,
we might use «mary_beach_night_happy.png» as the filename.
However, an image may refer to , not just static images. Thus, the same statements
that are used to display images can also be used for animations, solid
colors, and the other types of displayables.

Cross Platform — Computer and Mobile

One of Ren’Py’s biggest advantages is that runs on almost every computer. There are three primary platforms we support:

  • Windows Vista+ (x86, x86_64)
  • Mac OS X 10.10+ (x86_64)
  • Linux (x86, x86_64)

The Ren’Py launcher makes it possible to build versions of Ren’Py games for all three from any of these three platforms, making it possible to develop (for example) Mac and Linux versions on Windows.

Ren’Py games are not dependent on any other software on these platforms. There’s no need for your users to download runtimes, drivers, codecs, or anything like that. If a user has one of the supported platforms, Ren’Py will run. (Even if not, Ren’Py is written using portable technologies like pygame, and so can probably be made to run.)

Text Displayables link

Text can also be used as a , which
allows you to apply transforms to text, displaying it as if it was an
image and moving it around the screen.

(style=u’default’, **properties)

This is a displayable that can be shown with an additional string
parameter, which then shows that string as if it was an image.
This is usually used as part of the pre-defined image.

For example, one can do:

show text "Hello, World" at truecenter
with dissolve
pause 1
hide text
with dissolve

You can use ParameterizedText directly to define similar images with
different style properties. For example, one can write:

image top_text = ParameterizedText(xalign=0.5, yalign=0.0)

Additional Downloads

Raspberry Pi Support: renpy-7.4.2-raspi.tar.bz2
Contains files required to allow Ren’Py to run on the Raspberry Pi. This should be untarred in the Ren’Py sdk directory.
Ren’Py Source Code: renpy-7.4.2-source.tar.bz2
Contains the source code of the Ren’Py distribution without any binary components.
Pygame_SDL2 Source Code: pygame_sdl2-2.1.0-for-renpy-7.4.2.tar.gz
Contains the source code for the version of pygame_sdl2 required to run this version of Ren’Py. This may be newer than any released version of pygame_sdl2.
Other Dependencies: https://www.renpy.org/doc/html/license.html
Ren’Py contains free software licensed under a number of licenses, including the GNU Lesser
General Public License. A full list of software and links to git repositories from which the software
can be downloaded is linked above.
Checksums: checksums.txt
Checksums for the various files making up the Ren’Py distribution.

We also maintain a complete list of releases.

Announcement

I’m pleased to announce Ren’Py 6.99 «Here’s to the crazy ones.» This release
focuses on modernizing Ren’Py by moving to the SDL2 family of libraries. This
modernization will lead to a series of benefits, both now and in the future.

This release is being managed as a rolling release leading to Ren’Py 7.0.
New features may be added in point releases.

Perhaps the most obvious benefit is the addition of iOS support. Ren’Py can
now produce iOS apps, targeting iPhone and iOS devices. To develop for iOS,
you will need a Macintosh computer and paid iOS developer license, and will
need to customize the interface to conform to iOS policies.

In addition, this release includes:

  • Rewritten Android support, based on SDL2. Among other things, Android now
    supports the onscreen keyboard, rotating the screen, and bidirectional text.
  • Audio playback, using the same code on desktop and mobile platforms, so the
    same audio files can be used on all platforms Ren’Py supports.
  • Support for Input Methods (IMEs), allowing text entry in non-English languages.
  • A high-level achievement API, including support for Steam achievements. (Steam
    support will be made available on request to Steam developers.)
  • Improved support for custom text tags.
  • A Russian translation of the tutorial game, and a Finnish translation of
    the launcher.

To this, the 6.99.2 release adds:

  • Support for the images directory. Image files placed into this directory
    are automatically defined as images in Ren’Py,
  • The new AlphaMask displayable, which allows the alpha channel of one
    displayable to be masked by that of another.

The 6.99.4 release adds:

  • The new default statement, which is used to set the initial value of a
    variable in a game.
  • Support for the transclusion of screen language code inside use statements,
    and support for creator-defined screen language statements.

The 6.99.5 release adds:

  • Much faster startup, especially on mobile platforms.
  • Better support for iOS 8.
  • Many other small features.

These releases also include a number of other fixes and improvements.

We’d like to thank Patrick Dawson for writing much of the code of Pygame_SDL2,
a new, SDL2-based implementation of the Pygame API, and Chris Mear, who created
the initial iOS port of Ren’Py that our current support is based on. Other
contributors include:

  • Asfdfdfd
  • Baekansi
  • Bbs3223474
  • Beuc
  • Caryoscelus
  • Daniel Luque
  • Denzil
  • Diapolo10
  • Evilantishad0w
  • Giuseppe Bertone
  • Huang Junjie
  • Javimat
  • Konstantin Nikolayev
  • Kyouryuukunn
  • Lapalissiano
  • Nolanlemahn
  • Renoa
  • RangHo Lee
  • rivvil
  • Tlm-2501
  • Zigmut

and myself, Tom «PyTom» Rothamel.

Downloads of Ren’Py 6.99 can be found at:

A full list of changes to Ren’Py can be found at:

A list of changes that may require you to update your game can be found at:

Replacing Transforms link

When an an ATL transform or transform defined using the class
is replaced by another class, the properties of the transform that’s being
replaced are inherited by the transform that’s replacing it.

When the statement has multiple transforms in the at list, the
transforms are matched from last to first, until one list runs out. For
example, in:

show eileen happy at a, b, c
"Let's wait a bit."
show eileen happy at d, e

the transform is replaced by , the transform is replaced by
, and nothing replaces the transform.

At the moment of replacement, the values of the properties of the old transform
get inherited by the new transform. If the old transform was being animated,
this might mean an intermediate value is inherited. For example:

transform bounce
    linear 3.0 xalign 1.0
    linear 3.0 xalign 0.0
    repeat

transform headright
    linear 15 xalign 1.0

label example
    show eileen happy at bounce
    pause
    show eileen happy at headright
    pause

In this example, the sprite will bounce from left to right and back until
the player clicks. When that happens, the from will
be used to initialize the of headright, and so the sprite
will move from where it was when the player first clicked.

The position properties (, , , and ),
have a special rule for inheritance — a value set in the child will override a value set
in the parent. This is because a displayable may have only one position, and
a position that is actively set takes precedence. These properties may be set in
multiple ways — for example, sets xpos and xanchor.

Finally, when a statement does not include and clause, the
same displayables are used, so no inheritence is necessary. To prevent inheritance,
show and then hide the displayable.

Input Values link

Input values are used with text inputs, to set the default text, to accept
changed text, to respond to the enter key, and to determine if the text is
editable by default. To create a new input value, subclass the
class.

Ren’Py-defined input values inherit from InputValue, which means that
all values also include Enable(), Disable(), and Toggle() methods that return
actions that enable, disable, and toggle editing, respectively. See also
the action.

(dict, key, default=True, returnable=False)

An input value that updates key in dict.

default
If true, this input can be editable by default.
returnable
If true, the value of this input will be returned when the
user presses enter.
(object, field, default=True, returnable=False)

An input value that updates field on object.

field
A string giving the name of the field.
default
If true, this input can be editable by default.
returnable
If true, the value of this input will be returned when the
user presses enter.
(pattern=u’Page {}’, auto=u’Automatic saves’, quick=u’Quick saves’, page=None, default=False)

An input value that updates the name of a file page.

pattern
This is used for the default name of a page. Python-style substition
is performed, such that {} is replaced with the number of the page.
auto
The name of the autosave page.
quick
The name of the quicksave page.
page
If given, the number of the page to display. This should usually
be left as None, to give the current page.
default
If true, this input can be editable by default.
(variable, default=True, returnable=False)

An input value that updates variable.

variable
A string giving the name of the variable to update.
default
If true, this input can be editable by default.
returnable
If true, the value of this input will be returned when the
user presses enter.

Announcement

I’d like to announce Ren’Py 6.99.11, the latest in a series of releases
that will culminate in Ren’Py 7, and one of the biggest Ren’Py releases
to date.

The biggest change is a new default GUI framework. Out of the box, the new
GUI looks more modern, works across a range of screen sizes, and supports
mobile devices out of the box. The GUI is also easier for creators of all
skill levels to customize, with re-theming accomplished by replacing image
files and optionally adjusting variables. The Ren’Py documentation now
includes a GUI customization guide explaining how to completely retheme
the new GUI.

Thanks go to Auro-Cyanide for the original design of the new GUI. (But
don’t blame her — we’ve had to stray quite a bit from that design in pursuit
of resolution independence.)

There have been a number of features added to Ren’Py to support the new GUI.

  • Ren’Py now natively supports a dialogue history/readback system.
  • File pages can be renamed by clicking on the page title/number.
  • Style properties that use image filenames can take a substitution,
    which causes a style prefix search.

And the usual set of non-GUI-related changes:

  • Android support has been partially rewritten. It now supports x86 in addition
    to ARM, supports immersive mode, and fixes problems downloading Android
    dependencies.
  • Ren’Py supports Chrome OS by converting an Android package using the Android
    Runtime for Chrome tool.
  • The Ren’Py script language supports locally-scoped labels.
  • Transforms support tiling the child multiple times, and panning over the child
    image by an angle.

A Vietnamese translation of the launcher and tutorial has been added by Thuong
Nguyen Huu. An Indonesian translation of the launcher and default project has
been contributed by Pratomo Asta Nugraha.

Ren’Py 6.99.11 is brought to you by:

  • Caryoscelus
  • Diapolo10
  • Edward Betts
  • Ferdinand Thiessen
  • Kevin Turner
  • Morgan Willcock
  • Nolanlemahn
  • Pratomo Asta N
  • Sapphi
  • Shiz
  • Vollschauer
  • Xavi-mat
  • Xela

and myself, Tom «PyTom» Rothamel.

Downloads of Ren’Py 6.99.11 can be found at:

A full list of changes to Ren’Py can be found at:

A list of changes that may require you to update your game can be found at:

Movie Displayables and Movie Sprites link

The Movie displayable can be used to display a movie anywhere Ren’Py can
show a displayable. For example, a movie can be displayed as the background
of a menu screen, or as a background.

The Movie displayable can also be used to define a movie sprite, which is
a sprite that is backed by two movies. The primary movie provides the
color of the sprite. A second movie, the mask movie, provides the alpha
channel, with white being full opacity and black being full transparency.

Movies played by the Movie displayable loop automatically.

A Movie takes two parameters:

play

A string giving the name of a movie file to play.

This should always be provided.

mask
A string giving the name of a movie file to use as an alpha mask. It should
be the same size, duration, and framerate as the movie file provided to
play.

Here’s an example of defining a movie sprite:

image eileen movie = Movie(play="eileen_movie.webm", mask="eileen_mask.webm")

The movie sprite can be shown using the show statement, which automatically starts the
movie playing. It will be automatically stopped when the displayable is hidden.

show eileen movie

e "I'm feeling quite animated today."

hide eileen

e "But there's no point on wasting energy when I'm not around."

A Movie displayable can also be used as part of a screen, provided it is created
during the init phase (for example, as part of an image statement.)

image main_menu = Movie(play="main_menu.ogv")

screen main_menu
    add "main_menu"
    textbutton "Start" action Start() xalign 0.5 yalign 0.5

Announcement

I’m mildly chagrined to announce Ren’Py 7.3.2. This is a patch release to Ren’Py
7.3, mostly intended to fix bugs and address issues that people have
reported. As some of the bugs have significant performance and correctness
impact, everyone who upgraded to Ren’Py 7.3.0 or 7.3.1 should move on to this version.

Ren’Py 7.3.1 added a few minor new features, including the ability to
customize descriptive text.

Ren’Py 7.3 is the first release of
Ren’Py with support for running on the web platform, inside a web browser
supporting HTML 5, Web Assembly, and WebGL. Right now, this support is in
beta, as it’s limited by the capabilities of the web platform itself, but
it’s suitable for making web demos of Ren’Py games.

In addition to that, this release adds many new features to Ren’Py. These
include:

  • Many improvements to creator-defined statements, allowing the parsing
    of Ren’Py statements and block, the catching of errors, and the ability
    to execute a second function after Ren’Py in the body of a statement
    has finished.
  • Screen language improvements, like the ability to capture screen language
    displayables into a variable and to use a property to determine if a screen
    is sensitive to input.
  • Text improvements, with self-closing text tags and the ability to control
    the capitalization of interpolated text.
  • Mobile platforms now support non-rectangular focus masks, and 64-bit Android
    is supported in time for the Google Play deadline.
  • There is a new Turkish translation of the launcher and Spanish translation of
    the tutorial game, while several of the other translations have been updated.

There are also a number of other changes, so check out the changelog for all
of what’s new.

Ren’Py 7.3 is brought to you by:

  • Andy_kl
  • Arda Güler
  • DragoonHP
  • Jan Beich
  • Kobaltcore
  • Lee Yunseok
  • Mal Graty
  • Moshibit
  • Nyaatrap
  • Pionere
  • Sylvain Beucler

and myself, Tom «PyTom» Rothamel.

Downloads of Ren’Py 7.3.2 can be found at:

A full list of changes to Ren’Py can be found at:

A list of changes that may require you to update your game can be found at:

Announcement

I’m happy to announce the release of Ren’Py 7, the result of over a decade
of development since Ren’Py 6 was released. Compared to that release, Ren’Py
7 adds many features uses have long since come to consider core parts of
the engine, such as ATL, Screen Language, OpenGL acceleration, support for
the Android and iOS platforms, Translations, Accessibility, and so much more.

Thanks to everyone who created with Ren’Py during the Ren’Py 6 series, when
Ren’Py and visual novels went from a tiny niche to something that is popular
and culturally relevant. I look forward to seeing where Ren’Py 7 takes us.

Compared to Ren’Py 6.99.14.3, this release adds a new layered image system,
which provides a cleaner replacement for the use of LiveComposite and
ConditionSwitch when it comes to building sprites from layered images
created in paint programs. There is a new syntax for such images, and
portions can be defined automatically. Layered images also interact better
with other portions of Ren’Py, such as the image predictor and interactive
director.

Other major changes are:

  • The ability to apply transitions to specific layers, making it possible to
    dissolve in a sprite while text is being shown.
  • A second row of ruby or interlinear text can now be shown.
  • A way of converting strings into custom displayables.
  • A French translation of the launcher and The Question.
  • An editing pass over the reference manual.

Apart from these, this release includes a few fixes and minor new features.
As always, check the changelog for complete details.

Ren’Py 7 is brought to you by
over 100 people from around the world,
and myself, Tom «PyTom» Rothamel.

Downloads of Ren’Py 7.0 can be found at:

A full list of changes to Ren’Py can be found at:

A list of changes that may require you to update your game can be found at:

Slow Text Concerns link

Ren’Py allows the creator or user to indicate that text should be
displayed slowly. In this case, Ren’Py will render the text to a
texture, and then draw rectangles from the texture to the screen.

Unfortunately, this means that it’s possible to get rendering
artifacts when characters overlap. To minimize these rendering
artifacts, ensure that the and
properties are large enough that lines do not
overlap. If the bottoms of characters on the first line are clipped,
especially if line_spacing is negative, consider increasing
.

Horizontal artifacts are also possible when characters are kerned
together, but these artifacts are less severe, as they exist for only
a single frame.

ATL Syntax and Semantics link

An ATL block consists of one or more logical lines, all at the same
indentation, and indented relative to the statement containing the block.
Each logical line in an ATL block must contain one or more ATL statements.

There are two kinds of ATL statements: simple and complex. Simple statements
do not take an ATL block. A single logical line may contain one or more ATL
statements, separated by commas. A complex statement contains a block, must
be on its own line. The first line of a complex statement always ends with a
colon .

By default, statements in a block are executed in the order in which they
appear, starting with the first statement in the block. Execution terminates
when the end of the block is reached. Time statements change this, as
described in the appropriate section below.

Execution of a block terminates when all statements in the block have
terminated.

Non-English Languages link

The default font for Ren’Py contains characters for English and many
other languages. For size reasons, it doesn’t contain the characters
required to render other languages, including Chinese, Japanese, and
Korean. In order to support these languages, a project must first
change the fonts it uses.

Ren’Py should then support most world languages without further
configuration. However, Korean can be written with or without spacing
between words. Ren’Py has a special mode to support Korean with
spaces, which can be enabled by setting:

define gui.language = "korean-with-spaces"

This can be changed from the default of «unicode» in gui.rpy.

Japanese has multiple rules for line breaking. We recommend starting with
«japanese-normal», and moving to «japanese-loose» or «japanese-strict» for
more or less break opportunities, respectively.

define gui.language = "japanese-loose"

Ideographic languages provide a large number of opportunities
for line breaking. To enable a faster but less-accurate line-breaking
algorithm, use:

define gui.language = "greedy"

The faster line-breaking algorithm is not be necessary unless the
game is displaying huge amounts of text, such as in NVL-mode.

The line breaking algorithms can be further configured using the
function.

Music and Sound link

Most Ren’Py games play music in the background. Music is played with the
statement. The play music statement takes a filename that
is interpreted as an audio file to play. Audio filenames are interpreted
relative to the game directory. Audio files should be in opus, ogg vorbis,
or mp3 format.

For example:

    play music "audio/illurock.ogg"

When changing music, one can supply a and a clause, which
are used to fade out the old music and fade in the new music.

    play music "audio/illurock.ogg" fadeout 1.0 fadein 1.0

The statement plays an audio file after the current file
finishes playing.

    queue music "audio/next_track.opus"

Music can be stopped with the statement, which can also
optionally take a fadeout clause.

    stop music

Sound effects can be played with the statement. Unlike music, sound
effects do not loop.

    play sound "audio/effect.ogg"

When a filename is in the «game/audio» directory, and the name without the
file extension can be used as a Python variable (that is, it begins with
a letter, and contains only letters, numbers, and underscores), it is possible
to play that file without using quotes.

For example, if «game/audio/illurock.ogg» exists, we can write:

    play music illurock

A Simple Game link

label start

    "Sylvie" "Hi there! How was class?"

    "Me" "Good..."

    "I can't bring myself to admit that it all went in one ear and out the other."

    "Me" "Are you going home now? Wanna walk back with me?"

    "Sylvie" "Sure!"

This is a very simple Ren’Py game. It doesn’t include any pictures or
music, but it does show a conversation between two characters, and a
line of narration.

To try this out, from the top screen of the launcher select «My Question»
project, and then choose «script.rpy» from under Edit File. If this is
your first time, Ren’Py will ask you to select an editor (we recommend
Editra for first time creators), and will download the editor you choose.
Then it will open the script file in the editor.

Once the editor opens, erase everything in script.rpy. We’re starting
from scratch, so you don’t need what’s there. Copy the example above into
script.rpy, and save it.

You’re now ready to run this example. Go back to the launcher, and
choose «Launch Project». Ren’Py will start up. Notice how, without any
extra work, Ren’Py has given you menus that let you load and save the
game, and change various preferences. When ready, click «Launch Project»,
and play through this example game.

This example shows some of the commonly-used Ren’Py statements.

The first line is a label statement. The label statement is used to
give a name to a place in the program. In this case, we create a label
named . The start label is special, as it’s where Ren’Py
scripts begin running when the user clicks «Start Game» on the main
menu.

The other lines are say statements. There are two forms of the say
statement. The first is a string (beginning with a double-quote,
containing characters, and ending with a double-quote) on a line by
itself, which is used for narration, and the thoughts of the main
character. The second form consists of two strings. It’s used for
dialogue, with the first string being a character name and the second
being what that character is saying.

Note that all the say statements are indented by four spaces. This is
because they are a block underneath the label statement. In Ren’Py,
blocks must be indented relative to the prior statement, and all of
the statements in a block must be indented by the same amount.

When strings contain double-quote characters, those characters need to
be preceded by a backslash. For example

    "Sylvie" "Did you ever hear Lincon's famous saying, \"The problem with Internet quotations is that many of them are not genuine.\""

Model Displayable link

The Model displayable acts as a factory to created models for use with the
model-based renderer.

class (size=None, **properties)

This is a displayable that causes Ren’Py to create a 2D or 3D model
for use with the model-based renderer, that will be drawn in a single
operation with the shaders given here, or selected by an enclosing
Transform or Displayable.

size
If not None, this should be a width, height tuple, that’s used to
give the size of the Model. If not given, the model is the size
of the area provided to it. The fit parameter to a texture takes
precedence.

If no mesh method is called, a mesh that sets a_position and a_tex_coord
to match the way Ren’Py loads textures is created if at least one texture
is supplied. Otherwise, a mesh that only sets a_position is used.

All methods on this calls return the displayable the method is called
on, making it possible to chain calls.

(displayable, fit=False)

This is the same as the texture method, except that the focus
and main parameters are set to true.

(width, height)

Creates a mesh that consists of a width x height grid of evenly
spaced points, connecting each point to the closest points
vertically and horizontally, and dividing each rectangle in
the grid so created into triangles.

width, height
The number of points in the horizontal vertical directions,
a integer that is at least 2.
(name, value)

Sets the value of a gl property.

name
A string giving the name of the GL property, including the «gl_»
prefix.
value
The value of the gl property.
(shader)

Adds a shader to this model.

shader
A string given the name of a shader to use with this model.
(displayable, focus=False, main=False, fit=False)

Add a texture to this model, by rendering the given displayable.
The first texture added will be , the second , a
and so on.

focus
If true, focus events are passed to the displayable. It’s
assumed that coordinate relative to the model map 1:1 with
coordinates relative to the displayable.
main
If true, this is marked as a main child of this displayable,
which allows it to be inspected using the displayable
inspector.
fit
If true, the Model is given the size of the displayable.
This may only be true for one texture.
(name, value)

Sets the value of a uniform that is passed to the shaders.

name
A string giving the name of the uniform to set, including the
«u_» prefix.
value
The value of the uniform. Either a float, a 2, 3, or 4 element
tuple of floats, or a Matrix.
Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector