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.


キャラクターの表情を変える

一枚絵ではなくパーツごとの複数の画像ファイルを使って画像を表示したいが、一つずつタイプしたくはないと思ったことはありますか? "show eileen happy at center with dissolve"とタイプすることに疲れていますか?

これはそんなあなたのためのものです。 LiveComposite と ConditionSwitchを使用した動的 displayableの世界にようこそ! 表情やポーズを変えるには単に$ Janetmood = mad"のように宣言すればいいだけです。

#Put this in your init section!
init:
#This declares a conditional image with a LiveComposite inside of it
image eileen = ConditionSwitch(
            "e_face == 'happy", LiveComposite(
                #If she's happy, call the LiveComposite
                (375, 480),
                (0, 0), "e.png",
                #This is the size of the sprite in widthxheight of pixels
                #I'm telling it not to move e.png but use the base dimensions and
                #the path to e.png. If I had it in a folder, it would be
                #"/foldername/imagename.format"
                #This is probably the "base" image or body.
                (94, 66), "e_happy.png",
                #This is 94 pixels to the right and 66 pixels down, if I remember correctly
                #This is the alternate face layer, which is put on top of the stack.
                #So the order goes bottom to top when you're listing images.
                ),
            "e_face == 'sad", LiveComposite(
                (375, 480),
                (0, 0), "e.png",
                (94, 66), "e_sad.png",
                #Don't forget your commas at the end here
                ),
            "e_face == None", "e.png")
            #If it's not set to anything, the neutral base "e.png" displays
            #Be sure to close your parentheses carefully

label start:
#This is how you call it during the game itself
show eileen
#This shows the LiveComposite "e.png" when e_face == None. We haven't changed it yet.
e "I'm neutral."
#Now we change the variable to happy.
$ e_face = "happy"
e "Now sprite is happy!"
#You can also declare ConditionSwitches in Character statements to
#change the side image.