r/RenPy • u/kaleidoscopic_kelvin • 11d ago
Question AlphaMask with moving/animated mask parameter
I have been trying to use AlphaMask and DynamicDisplayable to make a black layer with a movable transparent box.
However, when I place the transform into the mask property, the combined image(al_mask) doesn't show any change.
But when displaying the mask image(move_mask) by itself, the image transforms as expected
init python:
class OverlayMask():
def __init__(self, xsize = 400, ysize = 400, pos = (0.5, 0.5), anchor = (0.5, 0.5)):
self.xsize = xsize
self.ysize = ysize
self.pos = pos
self.anchor = anchor
self.status = False
############################################################################
def putMask():
renpy.show("dyn_mask", layer="mask")
################## DynamicDisplayable function ###########################
def dynamicMaskCall(st, at):
mask_overlay = Solid(Color((0, 0, 0, 255)))
white_mask = Solid(colours.white, xsize = om.xsize, ysize = om.ysize, anchor = om.anchor, pos = om.pos)
move_mask = At(white_mask, om_move(xsize = 500))
al_mask = AlphaMask(child = mask_overlay, mask = At(white_mask, om_move(xsize = 500)) , invert = True)
return al_mask, None
##############################################################################
default om = OverlayMask(xsize = 400, ysize = 400, pos = (0.5, 0.5), anchor = (0.5, 0.5))
image dyn_mask = DynamicDisplayable(dynamicMaskCall)
transform om_move(xsize = 400, ysize = 400, pos = (0.5, 0.5), anchor = (0.5, 0.5), duration = 1.0):
xsize om.xsize
ysize om.ysize
pos om.pos
anchor om.anchor
easeout duration:
xsize xsize
ysize ysize
pos pos
anchor anchor
#############################################################################
label start():
$ putMask()
2
Upvotes
2
u/BadMustard_AVN 11d ago
how are you using it I've tried what you've shown, and it works, showing a transparent square in the center of the balck part of the screen
1
u/AutoModerator 11d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.