Why Are All Groups Being Affected in My LayeredImage?

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
thefused
Newbie
Posts: 2
Joined: Mon Feb 26, 2024 4:01 pm
Contact:

Why Are All Groups Being Affected in My LayeredImage?

#1 Post by thefused »

Hey there, in my visual novel I've successfully created layeredimages. When I animate a transparent png by itself it behaves as expected. Once I make that animated panel an attribute in a layeredimage group and plug in "panel_push", the animation gets applied to every group being displayed instead of the designated group.

Anyone know what might be causing this and moreover, how to make the animation only apply to the group "actionpanel"? Thanks in advance.

Code: Select all

image animatedpanel:
    "panel01.png"
    linear 0.05 xoffset -4 yoffset 4
    linear 0.03 xoffset 3 yoffset -3
    linear 0.06 xoffset -2 yoffset 5
    linear 0.03 xoffset -2 yoffset -3
    linear 0.07 xoffset -2 yoffset 5
    linear 0.05 xoffset -2 yoffset -3
    linear 0.08 xoffset -0 yoffset 0
    repeat

layeredimage pagesequential:
    always:
        "bg1"

    group actionpanel:
        attribute panel_push "animatedpanel"
        attribute panel_lock "panel01"

    group comicborder:
        attribute border_static default "border"

label animationtest:

    scene blackbg
    show pagesequential
    with fade
    pause

    show pagesequential panel_push

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1030
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Why Are All Groups Being Affected in My LayeredImage?

#2 Post by m_from_space »

thefused wrote: Mon Feb 26, 2024 4:41 pm Anyone know what might be causing this and moreover, how to make the animation only apply to the group "actionpanel"? Thanks in advance.
Hmm, can you try doing it like this?

Code: Select all

transform mytrans:
    linear 0.05 xoffset -4 yoffset 4
    linear 0.03 xoffset 3 yoffset -3
    linear 0.06 xoffset -2 yoffset 5
    linear 0.03 xoffset -2 yoffset -3
    linear 0.07 xoffset -2 yoffset 5
    linear 0.05 xoffset -2 yoffset -3
    linear 0.08 xoffset -0 yoffset 0
    repeat

layeredimage pagesequential:
    always:
        "bg1"

    group actionpanel:
        attribute panel_push "panel01" at mytrans
        attribute panel_lock "panel01"

    group comicborder:
        attribute border_static default "border"

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2434
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Why Are All Groups Being Affected in My LayeredImage?

#3 Post by Ocelot »

Is "bg1" by any chance the same size as "panel01"?
< < insert Rick Cook quote here > >

thefused
Newbie
Posts: 2
Joined: Mon Feb 26, 2024 4:01 pm
Contact:

Re: Why Are All Groups Being Affected in My LayeredImage?

#4 Post by thefused »

Ocelot wrote: Tue Feb 27, 2024 8:55 am Is "bg1" by any chance the same size as "panel01"?
I tried simplifying the process by making all images the same dimensions, yeah.
m_from_space wrote: Tue Feb 27, 2024 7:39 am
thefused wrote: Mon Feb 26, 2024 4:41 pm Anyone know what might be causing this and moreover, how to make the animation only apply to the group "actionpanel"? Thanks in advance.
Hmm, can you try doing it like this?

Code: Select all

transform mytrans:
    linear 0.05 xoffset -4 yoffset 4
    linear 0.03 xoffset 3 yoffset -3
    linear 0.06 xoffset -2 yoffset 5
    linear 0.03 xoffset -2 yoffset -3
    linear 0.07 xoffset -2 yoffset 5
    linear 0.05 xoffset -2 yoffset -3
    linear 0.08 xoffset -0 yoffset 0
    repeat

layeredimage pagesequential:
    always:
        "bg1"

    group actionpanel:
        attribute panel_push "panel01" at mytrans
        attribute panel_lock "panel01"

    group comicborder:
        attribute border_static default "border"
Yeah I tried something like this at first actually, then I'd read somewhere on the forum to try putting the animation in an image by itself. Results came out the same. Thanks though. =/

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2434
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Why Are All Groups Being Affected in My LayeredImage?

#5 Post by Ocelot »

when offset is applied to inner image, it partially moves outside of image boundaries, changing them. This makes whole image be repositioned. For example if you aligned your image around 0.5, 0.5, after first line of animation it will move 2 pixels to the bottom-left.
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: limpciabatta