layeredimage moves to the left, when ATL image added

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
rururubell
Newbie
Posts: 13
Joined: Mon Sep 30, 2019 4:00 am
Deviantart: rururubell
Contact:

layeredimage moves to the left, when ATL image added

#1 Post by rururubell »

I want to add some animated emotion icons for my sprites. If I add simple animated icon like those:

Code: Select all

image Micro_Emo_Angry_Animated:
    "Micro_Emo_Angry_01"
    0.5
    "Micro_Emo_Angry_02"
    0.5
    repeat
It works well. But when I add this image with ATL to my layeredimage sprite:

Code: Select all

image Micro_Emo_Drop_Animated:
    contains:
        alpha 0.0
        "Micro_Emo_Drop"
        parallel:
            ease 1.0 ypos 30
        parallel:
            ease 0.6 alpha 1.0
The whole sprite moves to the left. I add these emo icons in sprite like this:

Code: Select all

    group micro_emo:
        pos( 100, 100 )
        attribute Micro_Angry:
            "Micro_Emo_Angry_Animated"
            #zoom 0.58

        attribute Micro_Drop:
            "Micro_Emo_Drop_Animated"
            #zoom 0.58
I also try to use xpos, ypos. But it not works too. Sprite shows correctly with Micro_Angry but moves left with Micro_Drop
Sorry for my English!

jeffster
Veteran
Posts: 409
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: layeredimage moves to the left, when ATL image added

#2 Post by jeffster »

It seems that images in ATL animations inherit properties from each other, such as positions, offsets etc. I had unexpected results trying to build animations from several pictures, with different offsets etc., spending whole day, until I got advice to use images of the same size.

So maybe that's the case with your images. Try to use them of the same size and account for possible side-effects like when you set an offset to one image, the next would start with the same.

(Maybe there are other ways but I haven't found them yet.)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Majestic-12 [Bot], Semrush [Bot]