Page 1 of 1

Making at clauses play nice with ATL

Posted: Sun Jun 13, 2010 1:12 pm
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?

Re: Making at clauses play nice with ATL

Posted: Sun Jun 13, 2010 1:43 pm
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.

Re: Making at clauses play nice with ATL

Posted: Sun Jun 13, 2010 1:56 pm
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.

Re: Making at clauses play nice with ATL

Posted: Sun Jun 13, 2010 2:47 pm
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.

Re: Making at clauses play nice with ATL

Posted: Sun Jun 13, 2010 2:48 pm
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.