Page 2 of 2

Re: I need help with animation

Posted: Tue Aug 02, 2011 3:33 pm
by zeo1fan
Wait, so I need to assign a number to the image rather than a word then? Some_move_trans sounds kind of vague. :o

Re: I need help with animation

Posted: Tue Aug 02, 2011 3:49 pm
by Alex
Your code looks rather messy now... slight changes and it would look fine.
At first, you should declare the transform and then - use it, like

Code: Select all

init:
    image Negi = "magic.png"

    transform some_move_trans:
        xalign 0.7 yalign 0.0
        linear 3 xalign 0.3 yalign 0.5

label start:
    show Negi with dissolve at some_move_trans

    L "Yo!"
In your example, it also mixed the showing of an ATL image (http://www.renpy.org/doc/html/atl.html# ... -statement) and transform declaration (http://www.renpy.org/doc/html/atl.html# ... -statement).
And pay more attention to indentation of lines (http://www.renpy.org/wiki/renpy/FAQ#How ... _blocks.3F)

Re: I need help with animation

Posted: Tue Aug 02, 2011 4:06 pm
by zeo1fan
So if I want to do a transform I need to definite it before Init? Sorry, please be patient. This is the first time I've ever programmed.

Re: I need help with animation

Posted: Tue Aug 02, 2011 4:16 pm
by Alex
zeo1fan wrote:So if I want to do a transform I need to definite it before Init? ...
Inside <init:> block. There you can declare transforms, displayables, characters, etc.

Re: I need help with animation

Posted: Tue Aug 02, 2011 4:50 pm
by zeo1fan
Okay. Now how do I set different options for the menu.

For example, if the player picks option A then so-and-so sees one image, but if the player picks option b then so-and-so sees another image. Basically, how do you specify what's going to happen when one option is picked?

Re: I need help with animation

Posted: Fri Aug 05, 2011 10:40 am
by squark
A menu command?

I'm quite tired but I'll think about this anyway.

So, you want a different image to be displayed depending on choices? Heh, we were all in the same boat once, so here's something that should work.

Below this line, define another image, like so:

Code: Select all

init:
    image Negi = "magic.png"
    image optA = "optA.png" #this is just for example, rename it to something meaningful
    image optB = "optB.png" # likewise
Then, do this where you want the menu called:

Code: Select all

    menu:
        "This is Option A" :
        show optA

        "This is Option B" :
        show optB
Alternatively, you can use jump labels if you want a bunch of stuff to happen afterwards:

Code: Select all

    menu:
        "This is Option A" :
        jump optA

        "This is Option B" :
        jump optB

# some other stuff

label optA :
    show optA
#some other stuff

label optB :
    show optB
#some other stuff
The jump system may seem like it's more work, but really it's quite handy. Just remember, jump always jumps to a label, and label has be named the exact same thing, see above. It can even share the same name as an image, but as the image is defined as an image, it's all good. This should be good enough. I'm quite tired and frazzled.

Hope this helps ^^