Could you not use some combination of
You must be registered to see the links
and
You must be registered to see the links
displayables?
I'm spitballing here, so this solution may not be what you are looking for... but, I've tested it and it works how I planned...
Let's say you have a base 1920x1080 picture
bedroom_ch01_s06_001.png
(chapter 1, scene 6, picture #1).
You could create a second "censorship" image... maybe a black rectangle 600x200. Let's call it
cens_600.png
.
Now, we create a new displayable using both those images...
Python:
image cens_bedroom_ch01_s06_001 = Composite(
(1920,1080),
(0,0), "bedroom_ch01_s06_001",
(660,440), "cens_600")
Where the background image is a baseline image which is then overlaid with the censorship image (placed at x=660, y=440).
Obviously, you might need a dozen or so "censorship" black bar images. Or black circles or black bars shown on a diagonal. Since your can only specify "put this at (x,y)" and not the size or direction.
However, you can use a single black image and crop it to various sizes you might need, without creating lots of separate image files.
Python:
# uses "fullblack.png" (1920x1080) file to create various smaller displayables.
image cens_600 = Crop((0, 0, 600, 200), "fullblack")
image cens_900 = Crop((0, 0, 900, 300), "fullblack")
Now we have the original image
bedroom_ch01_s06_001.png
and a displayable
cens_bedroom_ch01_s06_001
which is the same image with a black bar over it.
Next, we need only create a 3rd displayable which automatically picks either of these two images, based on the value of some variable. Let's call it
censored
.
Python:
image patch_bedroom_ch01_s06_001 = ConditionSwitch(
"censored == False", "bedroom_ch01_s06_001",
"True", "cens_bedroom_ch01_s06_001")
A quirk of
ConditionSwitch()
is that the last entry always needs to be
"True"
to ensure at least one image is always picked, for the times when all those other conditions above it result in
False
.
The end result is that the game need only do something like
scene patch_bedroom_ch01_s06_001
and the image displayed will be chosen based on the
censored
variable.
The full thing would look something like:
Python:
# --- script.rpy ---
define censored = True
image cens_600 = Crop((0, 0, 600, 200), "fullblack") # uses "fullblack.png"
image cens_900 = Crop((0, 0, 900, 300), "fullblack")
image cens_bedroom_ch01_s06_001 = Composite(
(1920,1080),
(0,0), "bedroom_ch01_s06_001",
(660,440), "cens_600")
image patch_bedroom_ch01_s06_001 = ConditionSwitch(
"censored == False", "bedroom_ch01_s06_001",
"True", "cens_bedroom_ch01_s06_001")
label start:
scene black with fade
"Welcome to my game."
scene patch_bedroom_ch01_s06_001 with dissolve
"That picture may or may not be censored."
if censored:
"Yup. It was definitely censored."
else:
"Nope. We saw everything."
"*** THE END ***"
return
Python:
# --- patch.rpy ---
init 1:
define censored = False
In a lot of ways, you'd be swapping one sort of complexity (creating multiple images) for another (creating custom displayables using code).
But it accomplishes your goal of having a blackout bar which is sometimes visible and sometimes not, while using a single original image per picture shown. Which at least means the disk space usage would be lower (though probably not a lot lower, since most images wouldn't need to be censored).
You could, of course, bypass the need for the
ConditionSwitch()
version of each displayable by coding something like this each time you want to pick between the images:
Python:
if censored:
scene cens_bedroom_ch01_s06_001 with dissolve
else:
scene bedroom_ch01_s06_001 with dissolve
I believe
Composite()
should also work for animations. But don't hold me to that.