Transforms inside AlphaMasks won't stay centered

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
jdlang
Newbie
Posts: 13
Joined: Wed Mar 22, 2017 2:59 pm
Contact:

Transforms inside AlphaMasks won't stay centered

#1 Post by jdlang »

Hi guys! Coding noob here, sorry.
I'm trying to make a dynamic kaleidoscope background using one source image and twelve masking images.
The way it's supposed to work: AlphaMasks form 6 pairs of 2 equal triangles each, positioned and rotated to form a hexagon. Inside these AlphaMasks, images perform a slow rotation, alternating between clockwise and counter-clockwise, imitating a kaleidoscope.
The thing is, it isn't working. When I show the images separately, they rotate around the screen's center as intended. But as soon as I feed them to the AlphaMasks, they start bouncing around inside the Masks. I've tried everything I could think of, but no success.

Here's the code:

Code: Select all

image testimage_anim01:
    "images/test_kal_1.png"
    xzoom -1.0 # horizontal flip for symmetry
    rotate_pad False
    truecenter
    linear 60.0 rotate -360.0 # counter-clockwise rotation for symmetry
    subpixel True

image testimage_anim02:
    "images/test_kal_1.png"
    rotate_pad False
    truecenter
    rotate 60.0 # initial rotation
    linear 60.0 rotate 360.0
    subpixel True

image testimage_anim03:
    "images/test_kal_1.png"
    xzoom -1.0
    rotate_pad False
    truecenter
    rotate 60.0
    linear 60.0 rotate -360.0
    subpixel True

image testimage_anim04:
    "images/test_kal_1.png"
    rotate_pad False
    truecenter
    rotate 120.0
    linear 60.0 rotate 360.0
    subpixel True

image testimage_anim05:
    "images/test_kal_1.png"
    xzoom -1.0
    rotate_pad False
    truecenter
    rotate 120.0
    linear 60.0 rotate -360.0
    subpixel True

image testimage_anim06:
    "images/test_kal_1.png"
    rotate_pad False
    truecenter
    rotate 180.0
    linear 60.0 rotate 360.0
    subpixel True

image testimage_anim07:
    "images/test_kal_1.png"
    xzoom -1.0
    rotate_pad False
    truecenter
    rotate 180.0
    linear 60.0 rotate -360.0
    subpixel True

image testimage_anim08:
    "images/test_kal_1.png"
    rotate_pad False
    truecenter
    rotate 240.0
    linear 60.0 rotate 360.0
    subpixel True

image testimage_anim09:
    "images/test_kal_1.png"
    xzoom -1.0
    rotate_pad False
    truecenter
    rotate 240.0
    linear 60.0 rotate -360.0
    subpixel True

image testimage_anim10:
    "images/test_kal_1.png"
    rotate_pad False
    truecenter
    rotate 300.0
    linear 60.0 rotate 360.0
    subpixel True

image testimage_anim11:
    "images/test_kal_1.png"
    xzoom -1.0
    rotate_pad False
    truecenter
    rotate 300.0
    linear 60.0 rotate -360.0
    subpixel True

image testimage_anim12:
    "images/test_kal_1.png"
    rotate_pad False
    truecenter
    linear 60.0 rotate 360.0
    subpixel True

image duod01:
    AlphaMask("testimage_anim01", "images/bg/kal_bg_alphamask_duodecant01.png")
    truecenter
    subpixel True

image duod02:
    AlphaMask("testimage_anim02", "images/bg/kal_bg_alphamask_duodecant02.png")
    truecenter
    subpixel True

image duod03:
    AlphaMask("testimage_anim03", "images/bg/kal_bg_alphamask_duodecant03.png")
    truecenter
    subpixel True

image duod04:
    AlphaMask("testimage_anim04", "images/bg/kal_bg_alphamask_duodecant04.png")
    truecenter
    subpixel True

image duod05:
    AlphaMask("testimage_anim05", "images/bg/kal_bg_alphamask_duodecant05.png")
    truecenter
    subpixel True

image duod06:
    AlphaMask("testimage_anim06", "images/bg/kal_bg_alphamask_duodecant06.png")
    truecenter
    subpixel True

image duod07:
    AlphaMask("testimage_anim07", "images/bg/kal_bg_alphamask_duodecant07.png")
    truecenter
    subpixel True

image duod08:
    AlphaMask("testimage_anim08", "images/bg/kal_bg_alphamask_duodecant08.png")
    truecenter
    subpixel True

image duod09:
    AlphaMask("testimage_anim09", "images/bg/kal_bg_alphamask_duodecant09.png")
    truecenter
    subpixel True

image duod10:
    AlphaMask("testimage_anim10", "images/bg/kal_bg_alphamask_duodecant10.png")
    truecenter
    subpixel True

image duod11:
    AlphaMask("testimage_anim11", "images/bg/kal_bg_alphamask_duodecant11.png")
    truecenter
    subpixel True

image duod12:
    AlphaMask("testimage_anim12", "images/bg/kal_bg_alphamask_duodecant12.png")
    truecenter
    subpixel True
As you can see, I've already tried truecentering the AlphaMasks to fix this, since that stopped the animations bouncing when separately shown. I've also tried doing this with xpos and ypos. In addition, I've tried several variations of this in a LiveComposite for two days.
There are a few more problems with this thing, but let's keep it to one question for now.
I've attached two screenshots: one shows a test animation doing what it's supposed to, the other shows the sorry state of the kaleidoscope.
Any help is appreciated. Thanks!
Attachments
screenshot0004.png
screenshot0002.png

User avatar
ISAWHIM
Veteran
Posts: 318
Joined: Sun Nov 06, 2016 5:34 pm
Contact:

Re: Transforms inside AlphaMasks won't stay centered

#2 Post by ISAWHIM »

Why not just use two images and two alpha-masks... You only seem to have Even/Odd orientation.

One is the evens masked, one is the odds masked. Rotate one image centered with one mask, the other image with the other mask.

I wonder if it is altering the "true center" with each subsequent rotation, in memory... You are using the same image-reff...

Try setting each "same image" to a unique variable... If that resolves the issue, then it is using the "same rotated/positioned", renpy-store of the same exact "altered" image, as each next set.

I say that because the rotation rolls the round edge across four fins, at deeper positions, but on the others, the edge is off-center out of view. Suggesting it is altering alterations then altering those alterations, on each display... not resetting each to "unrotated" and "unpositioned", and rotating to the new positions, or angles.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]