Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the proper way to add items dynamically? #82

Open
tareq0065 opened this issue Nov 8, 2022 · 3 comments
Open

What is the proper way to add items dynamically? #82

tareq0065 opened this issue Nov 8, 2022 · 3 comments
Labels

Comments

@tareq0065
Copy link

tareq0065 commented Nov 8, 2022

I need to add the scene items dynamically. But when I add any new item, it's stacked and animations are not working. I have tried to add new item like below. What will be the proper way to add items dynamically?

Description

const newLayer = JsCanvas.newItem(`.Layer-${name}`, {
			iterationCount: 1,
			selector: true,
			delay: delay,
		});
		newLayer.set(keyframes);
		JsCanvas.setItem(`.Layer-${name}`, newLayer);
@daybrush
Copy link
Owner

@tareq0065

Calling the newItem and set methods is the correct usage and is the way to add items dynamically.

Is there any demo? It is difficult to determine the cause of this alone.

@Allakazan
Copy link

There is any update on this ? i need to re-create the useScene paremeters, how can i do that ?

@daybrush
Copy link
Owner

daybrush commented Feb 8, 2023

@Allakazan

There is a set function in the result of useScene.

Use the set(....) function.

#84 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants