curious ATL behavior

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
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

curious ATL behavior

#1 Post by Kia »

after creating a simple transform I'm experiencing an odd behavior about the "transform_anchor" my code is:

Code: Select all

transform place:
    anchor(.5,.5)
    transform_anchor True
    rotate_pad True
    xalign .8
    yalign .9
    rotate -170 
I'm trying to position my object relative to its center point but when transform_anchor is set to true the rotate anchor seems to move to somewhere near (1.0,1.0) and when I set it to false it goes back to the center but the anchor for align goes somewhere way beyond objects (1.0,1.0) and I have to set my align around 1.5 for both x and y to move the center of my object near the bottom right corner of the screen. anybody have any Idea what's wrong?
I'm using renpy 6.99.6.739

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: curious ATL behavior

#2 Post by PyTom »

You can't use align and anchor at the same time - align sets anchor. Consider using xpos and ypos instead.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: curious ATL behavior

#3 Post by Kia »

Thank you Tom ^_^

ForklessAnon
Regular
Posts: 49
Joined: Fri Sep 06, 2013 1:13 am
Contact:

Re: curious ATL behavior

#4 Post by ForklessAnon »

In relation to the thread subject, I ran across a strange occurrence that might be a bug with either the ATL or viewports.

Problem:
I'm trying to have a screen that can browse various images including those used as backgrounds. It has 2 modes: actual size and fitted zoom. It works perfectly with the exception of the below image code which is a concourse area with an animated fountain.
This bug is particular in that it is only present when an ATL with 2 or more contains statements are added to a screen viewport.
What seems to be happening is that the entire ATL is getting cropped to the size of the viewport, and when the zoom value is added to the add statement the ATL is scaled as expected but the ATL is still cropped in the same manner, so only the cropped part is visible even when zoomed.
In addition, when in actual size, it should be able to be dragged around to view the image details, but it doesn't because it seems the viewport thinks that the cropped image is the actual image size when it's supposed to be larger. (Visual example in the diagram below.)

If any more details or description is needed, please let me know. Any help or advice is greatly appreciated.

Code:
(The code that the snippet comes from has worked perfectly for everything I've tested except the above issue.)

Code: Select all

screen photo_viewer:
    #-snip-
    viewport id "view":
        draggable True mousewheel True
        if current:
            if zoom == "full":
                add i
            elif zoom == "fit":
                add i zoom calculated_zoom_value   #zoom is calculated in a separate function
    #-snip-

init -2:
    image bg concourse fountain:
        contains:
            xalign 0.5 yalign 0.5
            "images/bg/concourse_01.jpg"
        contains:
            xpos 0.932 xanchor 0.5 ypos 0.518 yanchor 1.0
            block:
                "images/bg/concourse_01_water_01.png"
                0.12
                "images/bg/concourse_01_water_02.png"
                0.12
                "images/bg/concourse_01_water_03.png"
                0.12
                "images/bg/concourse_01_water_04.png"
                0.12
                "images/bg/concourse_01_water_05.png"
                0.12
                repeat
Diagram:
(The images themselves cannot be shown here for production reasons, so this diagram will have to do.)
Image

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: curious ATL behavior

#5 Post by Kia »

try wrapping your image inside something like a frame or fixed then experiment with different ways of adding zoom.

ForklessAnon
Regular
Posts: 49
Joined: Fri Sep 06, 2013 1:13 am
Contact:

Re: curious ATL behavior

#6 Post by ForklessAnon »

I've tried that, all that does is add a fixed element on the outside of the ATL. The issue seems to be within the ATLTransform in relation to how the Fixed element affects the layout. When looking at the inspector, the structure of the image that is added to the is the ATL wraps a Fixed which holds the ATL elements of each contains statement, which I believe is the expected structure of ATL with contains. Seen as such:

Code: Select all

Viewport:
    ATLTransform:
        Fixed:
            ATLTransform:
                Image ... bg/concourse_01.jpg
            ATLTransform:
                Image ... rse_01_water_03.jpg
Pytom, do you have any thoughts?

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: curious ATL behavior

#7 Post by Kia »

it seems totally different than the problem I had and I'm not that experienced with python. all I can add is you can't use size, minimum and maximum with "add" command either. that's why I suggested adding it to a frame and try re-sizing the frame some other way.

Post Reply

Who is online

Users browsing this forum: No registered users