Tsparticles: Multiple images with different animation

Created on 27 Aug 2020  路  6Comments  路  Source: matteobruni/tsparticles

I have 2 different images, I need the first image to move up and the other one to move down, is there a way I can assign a "move" object with all of its options to each image?

bug question

All 6 comments

Issue-Label Bot is automatically applying the label question to this issue, with a confidence of 0.63. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Hi @thegodliek,

Yes it's possible, I created a pen here

https://codepen.io/matteobruni/pen/MWymBxX

In short, you need this configuration:

shape: {
    type: "image",
    options: {
        image: [
            {
                src: "https://particles.matteobruni.it/images/fruits/apple.png",
                width: 32, // this width is used only for image ratio
                height: 32, // this height is used only for image ratio
                particles: { /* here you can specify all the particles options you want */
                    move: {
                        direction: "top"
                    }
                }
            },
            {
                src: "https://particles.matteobruni.it/images/fruits/avocado.png",
                width: 32, // this width is used only for image ratio
                height: 32, // this height is used only for image ratio
                particles: { /* here you can specify all the particles options you want */
                    move: {
                        direction: "bottom"
                    }
                }
            }
        ]
    }
}

Thank you for the response, it's what I was looking for, but in your example, the apple.png image is set to move to top, but some of them are moving down!

Is there anyway to fix that?

Yes I noticed that and I'm currently investigating

tsParticles v1.17.10 is out with the bug fix

Thank you very much! The issue is now fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paul300497 picture paul300497  路  5Comments

matteobruni picture matteobruni  路  6Comments

JonasWN picture JonasWN  路  4Comments

matteobruni picture matteobruni  路  5Comments

matteobruni picture matteobruni  路  5Comments