daybrush / scenejs

🎬 Scene.js is JavaScript & CSS timeline-based animation library

Home Page:https://daybrush.com/scenejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can i set the useNowFrame object dynamically on react-scenejs ?

Allakazan opened this issue · comments

I need to generate the useNowFrames dynamically through the user input. How can i do that ?

scenes.map((scene, si) => {      
  scene.layers.map((layer, li) => {
    const sceneItem = currentScene.getItem(`.txt-${si}-${li}`);

    const frame1 = useNowFrame(sceneItem.getItem(li));

    console.log(frame1)
  })
})

Some code for example

@Allakazan
sorry. useNowFrame (i.e. reactive component) cannot be called dynamically and its number cannot be changed.

If you're like me, I recommend using item.getNowFrame().