ATL positioning question

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
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

ATL positioning question

#1 Post by akemicchi »

I'm still learning how to use ATL, but I'm having some positioning issues. If someone could help me out and explain what I'm doing wrong, I'd really appreciate it! :)

Code: Select all

    transform gag_pos:
        zoom 0.5 xalign 0.5 yalign 0.2
This works fine when the image is just a simple line like:

Code: Select all

image gag_event3 = "gag_event3.PNG"
As you can see here, it's positioned where I want it to be: in the center, a little closer to the top.
screenshot0007.png
I show the images like

Code: Select all

show gag_event3 at gag_pos
But when I use this code and apply the transform on it, the xalign doesn't position it in the center. yalign works though?

Code: Select all

[code]image gag_event2:
    contains:
        "gag_event2_background.PNG" # The background image. Static.
    contains:
        "gag_event2_characters.PNG" # The characters. They shake.
        choice:
            xoffset 2 yoffset 2
        choice:
            xoffset 2 yoffset -2
        choice:
            xoffset -2 yoffset 2
        choice:
            xoffset -2 yoffset -2
        choice:
            xoffset 1 yoffset 1
        choice:
            xoffset 1 yoffset -1
        choice:
            xoffset -1 yoffset 1
        choice:
            xoffset -1 yoffset -1
        pause 0.1
        repeat
    contains:
        "gag_event2_vein1.PNG" # Vein is animated. Changes every 0.5 seconds.
        pause 0.5
        "gag_event2_vein2.PNG"
        pause 0.5
        repeat
[/code]
screenshot0009.png
It might be important to mention that the images are twice their size and I'm only resizing them with ATL. I could mess around with xpos to get it where I want to, make multiple images and show them all individually, or just save the images at window size. It's not that big of a deal. But I'm wondering what I'm doing wrong so I can avoid it. Am I using contain right? What's causing it to move to the right like that? Weird things happen when I change xanchor and yanchor, too. Setting xanchor and yanchor to 0.1, 0.1 positions the image offscreen at the bottom right; xanchor at 1.0 and yanchor at 1.0 puts it at xanchor 0.0 xpos 0.0, yanchor 0.5 ypos 1.0. I have no idea what's making it do that.

Thanks so much for your time!

Post Reply

Who is online

Users browsing this forum: No registered users