Making at clauses play nice with ATL

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
Spiky Caterpillar
Veteran
Posts: 253
Joined: Fri Nov 14, 2008 7:59 pm
Completed: Lots.
Projects: Black Closet
Organization: Slipshod
Location: Behind you.
Contact:

Making at clauses play nice with ATL

#1 Post by Spiky Caterpillar »

For a while now, I've been wanting to have ATL play more nicely with at clauses, so that code like

Code: Select all

init python:
    dispcenter = Position(xalign=0.5,ypos=620,yanchor=1.0)
show grabiner angry at dispcenter:
    alpha 1.0
    linear 1.0 alpha 0.0
works the same as

Code: Select all

show grabiner angry:
    parallel: # 'parallel' to make it easier to add sensible behaviour for animated at clauses
        xalign 0.5
        ypos 620
        yanchor 1.0
    parallel:
        alpha 1.0
        linear 1.0 alpha 0.0
So, my questions:
- Is there any good reason NOT to add this to Ren'Py?
- Is there anything wrong with my proposed behaviour? The obvious thing is that it may break some existing 6.10 code that relies, quite likely unintentionally, on ATL causing at lists to be completely ignored (especially if used in conjunction with sticky positioning)
- Is PyTom or anyone else already working on it?
- Is 6.11 changing the underpinnings of at and ATL enough that I should wait for it to be finished before working on it?
Nom nom nom nom nom LEAVES.

number473
Regular
Posts: 195
Joined: Tue Dec 15, 2009 4:20 am
Projects: The Duke's Daughter
Location: Cape Town
Contact:

Re: Making at clauses play nice with ATL

#2 Post by number473 »

I think that the reason for this is that the thing passed to the at clause is usually in fact an ATL transform (it has been since ATL was introduced). Positions like left and center are re-written as ATL transforms. But you can instead write this code totally using ATL as follows:

Code: Select all

transform dispcenter:
    xalign 0.5
    ypos 620
    yanchor 1.0

show grabiner angry:
    dispcenter
    alpha 1.0
    linear 1.0 alpha 0.0
What I mean is that they don't interact well but it's not really a problem because you can use ATL on its own.
Mental weather report: Cloudy with a possibility of brain storms.

Spiky Caterpillar
Veteran
Posts: 253
Joined: Fri Nov 14, 2008 7:59 pm
Completed: Lots.
Projects: Black Closet
Organization: Slipshod
Location: Behind you.
Contact:

Re: Making at clauses play nice with ATL

#3 Post by Spiky Caterpillar »

*sheepish look* I completely missed that. Okay, that would be a good reason not to worry unduly about trying to get Position()s to work with at. (Hm, or perhaps Position() should just return a transform? Which is a lot more practical than what I was vaguely thinking of doing.)

Thanks.
Nom nom nom nom nom LEAVES.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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: Making at clauses play nice with ATL

#4 Post by PyTom »

Spiky Caterpillar wrote: - Is there any good reason NOT to add this to Ren'Py?
- Is there anything wrong with my proposed behaviour? The obvious thing is that it may break some existing 6.10 code that relies, quite likely unintentionally, on ATL causing at lists to be completely ignored (especially if used in conjunction with sticky positioning)
- Is PyTom or anyone else already working on it?
- Is 6.11 changing the underpinnings of at and ATL enough that I should wait for it to be finished before working on it?
Respectively,

- No.
- No. While it can break existing code, such code would be meaningless in the current system, so it's unlikely anyone would have used it.
- I've already implemented this.
- Yes and no. Yes, there will be changes. But I suspect those changes won't really hurt existing code much, so you might as well get started now.
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
PyTom
Ren'Py Creator
Posts: 16088
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: Making at clauses play nice with ATL

#5 Post by PyTom »

Also, Position is obsolete, nowadays, and is retained for compatibility with older code. You might as well use Transform where you wanted to use Position.
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

Post Reply

Who is online

Users browsing this forum: No registered users