TransitionAnimation image positions

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Qu-ko
Regular
Posts: 54
Joined: Sun Jun 18, 2006 12:27 am
Location: Massachusetts, land of evil-ness
Contact:

TransitionAnimation image positions

#1 Post by Qu-ko » Tue Jan 22, 2008 12:49 am

...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...?
ヾ(゚Д゚)ノ うわあああぁぁぁぁぁぁぁ―――――――

User avatar
PyTom
Ren'Py Creator
Posts: 15506
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: TransitionAnimation image positions

#2 Post by PyTom » Tue Jan 22, 2008 12:54 am

Are you using 6.5? There were some bugs regarding this fixed in 6.5.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Qu-ko
Regular
Posts: 54
Joined: Sun Jun 18, 2006 12:27 am
Location: Massachusetts, land of evil-ness
Contact:

Re: TransitionAnimation image positions

#3 Post by Qu-ko » Tue Jan 22, 2008 12:56 am

PyTom wrote:Are you using 6.5? There were some bugs regarding this fixed in 6.5.
Yes, it's 6.5.
ヾ(゚Д゚)ノ うわあああぁぁぁぁぁぁぁ―――――――

User avatar
PyTom
Ren'Py Creator
Posts: 15506
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: TransitionAnimation image positions

#4 Post by PyTom » Tue Jan 22, 2008 2:41 am

Hm... can you put together a test case, and send it to me?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Qu-ko
Regular
Posts: 54
Joined: Sun Jun 18, 2006 12:27 am
Location: Massachusetts, land of evil-ness
Contact:

Re: TransitionAnimation image positions

#5 Post by Qu-ko » Tue Jan 22, 2008 6:15 pm

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.
ヾ(゚Д゚)ノ うわあああぁぁぁぁぁぁぁ―――――――

User avatar
PyTom
Ren'Py Creator
Posts: 15506
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: TransitionAnimation image positions

#6 Post by PyTom » Tue Jan 22, 2008 7:15 pm

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".
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Qu-ko
Regular
Posts: 54
Joined: Sun Jun 18, 2006 12:27 am
Location: Massachusetts, land of evil-ness
Contact:

Re: TransitionAnimation image positions

#7 Post by Qu-ko » Wed Jan 23, 2008 2:09 pm

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
ヾ(゚Д゚)ノ うわあああぁぁぁぁぁぁぁ―――――――

Post Reply

Who is online

Users browsing this forum: djinius, Mani