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.


TVの砂嵐のようなエフェクトを作る

これはフェイトステイナイトにあった気の利いたエフェクトで、それをRen'Py上で再現しようとしたものです。 多分正確に再現できているわけではないけれど、適切な場面で使えばビジュアルノベルにより味わいが出ます。

好きな画像編集ソフトを開いて(ここではphotoshopとします)、ゲーム画面の大きさのキャンパスを作ってください(最近は800x600がデファクトスタンダードです)。 背景が透明なキャンパスを作ったのなら、バケツで白く塗りつぶしてください。 フィルターツールバーから、「ノイズを加える」を探して、実行してください。 モノクロのノイズを使用し、約50%(各画像+/-0.01)で一様に配分すると次の5つの画像が得られました。

Image 1
Image 2
Image 3
Image 4
Image 5
ご覧のとおり、各画像はすこしずつ違っています。次にこれらすべてをanim.SMAnimation関数に代入しましょう。 そしてなめらかなアニメーションをするために、次のように5つすべてのstateとedgeを定義します。

image static = anim.SMAnimation("a",
        anim.State("a", "noise1.png"),
        anim.State("b", "noise2.png"),
        anim.State("c", "noise3.png"),
        anim.State("d", "noise4.png"),
        anim.State("e", "noise5.png"),
        
        anim.Edge("a", .2, "b", trans=Dissolve(.2, alpha=True)),
        anim.Edge("b", .2, "a", trans=Dissolve(.2, alpha=True)),
        anim.Edge("a", .2, "c", trans=Dissolve(.2, alpha=True)),
        anim.Edge("c", .2, "a", trans=Dissolve(.2, alpha=True)),
        anim.Edge("a", .2, "d", trans=Dissolve(.2, alpha=True)),
        anim.Edge("d", .2, "a", trans=Dissolve(.2, alpha=True)),
        anim.Edge("a", .2, "e", trans=Dissolve(.2, alpha=True)),
        anim.Edge("e", .2, "a", trans=Dissolve(.2, alpha=True)),

        anim.Edge("b", .2, "c", trans=Dissolve(.2, alpha=True)),
        anim.Edge("c", .2, "b", trans=Dissolve(.2, alpha=True)),
        anim.Edge("b", .2, "d", trans=Dissolve(.2, alpha=True)),
        anim.Edge("d", .2, "b", trans=Dissolve(.2, alpha=True)),
        anim.Edge("b", .2, "e", trans=Dissolve(.2, alpha=True)),
        anim.Edge("e", .2, "b", trans=Dissolve(.2, alpha=True)),
        
        anim.Edge("c", .2, "d", trans=Dissolve(.2, alpha=True)),
        anim.Edge("d", .2, "c", trans=Dissolve(.2, alpha=True)),
        anim.Edge("c", .2, "e", trans=Dissolve(.2, alpha=True)),
        anim.Edge("e", .2, "c", trans=Dissolve(.2, alpha=True)),

        anim.Edge("d", .2, "e", trans=Dissolve(.2, alpha=True)),
        anim.Edge("e", .2, "d", trans=Dissolve(.2, alpha=True)),
        )

正しく入力できましたか。たんに画像を表示するよりもdissolveを使うと、より粗く見えます。 This looks perfect, even though it might be a tad memory consumptive. もし変化がゆっくりすぎると感じるのなら、edgeのdelay("trans"の前にある最初の数字)を.15 や .1のように小さくしましょう。

実際に使うには、ゲーム内の呼び出したいときに単にこのように呼び出すだけです。

show static

最後に、これらの画像は不透明(忠実に指示に従った場合)であるので、エフェクトの下は何も見えないことを覚えておいてください。 これを変えるには、次の方法があります。:

So this was my first cookbook recipe, hope you like it! Thanks goes to FIA and PyTom for correcting the script, now everything will work if you use opacity changes with im.Alpha (or use transparent .pngs, but as I said, that's less flexible).

EvilDragon