Why does adding atl change a displayables position, and how to prevent it?

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
Gachapen
Newbie
Posts: 16
Joined: Sat Jan 14, 2023 12:48 pm
Contact:

Why does adding atl change a displayables position, and how to prevent it?

#1 Post by Gachapen »

I have tried searching, but there seems to be no other mentions of this. I even tried on a fresh windows install and it still happens, so I assume I am doing something conceptually wrong, or it is a bug. Whenever I add any atl to a displayable, its position on screen will change. This can be reproduced by anyone. Open up "The Tutorial" and edit line 148 in script.rpy to

show eileen vhappy:
blur 1.0

She will move from her default position to the left side of the screen. This happens will all atl that I tested. What am I doing wrong?

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1031
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Why does adding atl change a displayables position, and how to prevent it?

#2 Post by m_from_space »

I don't think you're doing anything wrong. I can confirm the behavior, but I don't see a problem here to be honest. It only happens if you didn't already show this image, so that the position is set in stone. For example if you add the blur to line 156, Eileen will not change her position.

Normally when you show an image/Displayable, you define where you want to show it right? When showing an image for the first time while using ATL, just make sure you define where you want it to be placed, otherwise it defaults to position x=0 and y=0.

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Why does adding atl change a displayables position, and how to prevent it?

#3 Post by _ticlock_ »

Gachapen wrote: Thu May 18, 2023 4:37 am She will move from her default position to the left side of the screen. This happens will all atl that I tested. What am I doing wrong?
In addition to m_from_space comment:

1) A show statement without specifying a transform uses the default transform config.default_transform

2) A show statement with a transform uses the specified transform (default transform is not used).

3) Appling transform to an image that is already shown (or replacing an image that has the same image_tag) replaces the previous transform to the new one.
(Replacing Transforms)
Note: The properties of the transform that's being replaced are inherited by the transform that's replacing it

If you want to apply an additional transform to the default one, you can do the following:

Code: Select all

show eileen vhappy at default:
    blur 1.0
Or

Code: Select all

transform blur_transform:
    blur 1.0
label some_label:
    show eileen vhappy at default, blur_transform
Or even:

Code: Select all

show eileen vhappy
show eileen vhappy:
    blur 1.0

Gachapen
Newbie
Posts: 16
Joined: Sat Jan 14, 2023 12:48 pm
Contact:

Re: Why does adding atl change a displayables position, and how to prevent it?

#4 Post by Gachapen »

_ticlock_ wrote: Thu May 18, 2023 10:24 am
Gachapen wrote: Thu May 18, 2023 4:37 am She will move from her default position to the left side of the screen. This happens will all atl that I tested. What am I doing wrong?
In addition to m_from_space comment:

1) A show statement without specifying a transform uses the default transform config.default_transform

2) A show statement with a transform uses the specified transform (default transform is not used).

3) Appling transform to an image that is already shown (or replacing an image that has the same image_tag) replaces the previous transform to the new one.
(Replacing Transforms)
Note: The properties of the transform that's being replaced are inherited by the transform that's replacing it

If you want to apply an additional transform to the default one, you can do the following:

Code: Select all

show eileen vhappy at default:
    blur 1.0
Or

Code: Select all

transform blur_transform:
    blur 1.0
label some_label:
    show eileen vhappy at default, blur_transform
Or even:

Code: Select all

show eileen vhappy
show eileen vhappy:
    blur 1.0

Thank you. These workarounds do work.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Silac