This page is out of date

You've reached a page on the Ren'Py wiki. Due to massive spam, the wiki hasn't been updated in over 5 years, and much of the information here is very out of date. We've kept it because some of it is of historic interest, but all the information relevant to modern versions of Ren'Py has been moved elsewhere.

Some places to look are:

Please do not create new links to this page.


キャラクターの口を動かす

時にキャラクターの口の動きをセリフと同期させたいと思うことがあるでしょう。 以下は唇を動かすためのものです。

まずlip_flap.rpyをダウンロードしてきて、gameディレクトリに加えてください。 このファイルにはLipFlap関数の定義が含まれています。 この関数は唇を動かすための、showステートメントで使用可能なオブジェクトを返します。

prefix - 唇を動かすために使用されるファイル名の接頭辞です。

default - 引数が与えられない時のデフォルトの唇です。

suffix - 使用される接尾辞です。

combine - 3つの引数(prefix, lip, and suffix)をひとつのdisplayableに合成するための関数です。デフォルトの合成関数はImage(prefix + lip + suffix)です。これは望むなら変更でき、say the lips onto a larger character image.

唇を動かすために、最初にLipFlapを使用する画像を宣言します。 そして差し替える口と、その表示時間で構成される文字列をパラメータとして画像を表示します。 最初の口が表示され、最初の時間を開けて次の口が表示され、次に指定した時間をおいて、と続きます。 文字列が口で終われば、その口がその後表示され続けます。時間で終われば、その時間の後にまた最初から繰り返します。

これと同時にまばたきをする例は次を参照してください。キャラクターのまばたきと喋りアニメーション

Example

# Note that Ayaki_ShyA.png, Ayaki_ShyB.png, and Ayaki_ShyC.png all exist in the 
# game directory.

init:
    image ayaki shy = LipFlap("Ayaki_Shy", "A", ".png")

label ayaki:

    scene bg whitehouse

    # Show Ayaki with her default lip, A. 
    show ayaki shy

    "..."

    # Show Ayaki with varying lips.
    show ayaki shy "A .15 B .20 C .15 A .15 C .15 A"
    "Ayaki" "Whatsoever, things are true."

    return