Page 1 of 1

TransitionAnimation image positions

Posted: Tue Jan 22, 2008 12:49 am
by Qu-ko
...I lied, I had another problem after all. .-.

Okay, so I'm using TransitionAnimation, and I want to create the effect of a sword slash. I have this as the script:

Code: Select all

    $ shortflash = Fade(.13, 0, .13, color="#ffffff")
    
    $ shortdissolve = Dissolve(0.15)
    
    image rightslash1 = anim.TransitionAnimation("rightslash1.png", 0.1, shortflash, 
                                                "rightslash2.png", 0.2, shortdissolve,
                                                "rightslash3.png", 0.1, shortdissolve,
                                                "#000000")
But when I run it, something strange happens with the images. The images display, and the transitions run properly, but the image placement is... a little weird. They display a little bit upwards of their proper position, maybe about 50px up; then when the transition begins to run, they go back down to the center. All three images do this. Positioning them with something like this:

Code: Select all

    $ center = Position(xpos=0.5, xanchor='center', ypos=0.5,
                    yanchor='center')
doesn't work; it still does the same thing.

The images are all 1024x768 in size, and I'm positive they're lined up correctly when I look at them in an image editor. The Ren'Py screen they're appearing on is 1024x600, but that shouldn't be a problem, should it...?

Re: TransitionAnimation image positions

Posted: Tue Jan 22, 2008 12:54 am
by PyTom
Are you using 6.5? There were some bugs regarding this fixed in 6.5.

Re: TransitionAnimation image positions

Posted: Tue Jan 22, 2008 12:56 am
by Qu-ko
PyTom wrote:Are you using 6.5? There were some bugs regarding this fixed in 6.5.
Yes, it's 6.5.

Re: TransitionAnimation image positions

Posted: Tue Jan 22, 2008 2:41 am
by PyTom
Hm... can you put together a test case, and send it to me?

Re: TransitionAnimation image positions

Posted: Tue Jan 22, 2008 6:15 pm
by Qu-ko
http://www.megaupload.com/?d=Q5I3VAPE

That's the three images I'm using, the basic script for running it, and the options file in case it happens to be something in there that's causing the problem.

If it works fine for you without the positions shifting, I can always record a desktop movie of what's happening when I try to run it to show you better.

Re: TransitionAnimation image positions

Posted: Tue Jan 22, 2008 7:15 pm
by PyTom
Okay, the problem here is that when "#000000" is rendered, it creates an image that's the same size of the screen. (In your case, that's 1024x600.) Meanwhile, all of your other images are bigger than the screen (1024x768). When you do a dissolve between two images of differing size, Ren'Py lines up their upper-left corners, and takes the overlap. The result is an image that's 1024x600, but a different chunk of rightslash3 than was used previously... this is blitted to the screen in a different location.

You have two ways to fix this:

- The obvious one is to crop all of your images to 1024x600. This is probably a good idea anyway, as if you ship pictures bigger than the screen, you're just wasting disk space and bandwidth.

- The other way would be to create a 1024x768 black image, and use that instead of "#000000".

Re: TransitionAnimation image positions

Posted: Wed Jan 23, 2008 2:09 pm
by Qu-ko
Meh, you have a point in it wasting space. >< I wound up cropping the images, and it works like it should now; I was too lazy to crop before, and I didn't think of that at the time.

Thank you, though, for pointing that out. :D