I've got it working to the point that the alpha layer animates properly
Odd. When I tried to replicate your example I couldn't get the positional part of the animation to work at all. Which version of Renpy are you using?
In general using ATL transforms that change the position of 'TargetImage' or 'AlphaImage' had no effect.
After digging through the Renpy source code a bit, it looks like the AlphaMask class just never runs the code that positions images, so they always get placed at (0,0). I tried creating an alternate version that does position images, but that turned out to be harder than I excepted.
However instead of getting AlphaMask to position the images itself, you can bre-bake displayables that incorporates the positional changes and pass those to AlphaMask.
Sorry if I'm not really making sense here. It's difficult to explain if you aren't somewhat familiar with how Renpy renders objects.
Long story short, put your displayables inside a "Fixed" element of a fixed size before passing them on to AlphaMask.
Ex:
Code: Select all
#Add this somewhere
init python:
def FixedWrapper(child,width,height):
rv = renpy.display.layout.Fixed(xmaximum=width, ymaximum=height, xminimum=width, yminimum=height)
rv.add(child)
return rv
# Instead of
image test = AlphaMask("target","mask")
# use
image test = AlphaMask(FixedWrapper("target",800,600),FixedWrapper("mask",800,600))
# Where the width and height parameters denote the region your moving displayable is contained in
# If the displayable doesn't move at all then you don't need to add a wrapper
In your case, replace the first bit with
Code: Select all
init python:
def FixedWrapper(child,width,height):
rv = renpy.display.layout.Fixed(xmaximum=width, ymaximum=height, xminimum=width, yminimum=height)
rv.add(child)
return rv
image TestLC = LiveComposite(
(100, 100),
(0, 0), "BaseImage",
# Since this entire LiveComposite is 100x100, the AlphaImage doesn't need more space than that
(0, 0), AlphaMask("TargetImage", FixedWrapper("AlphaImage",100,100)),
)
and it should work.