Copy & Paste components

Copy & Paste Components

A simple demonstration, you will have three components on page1, and then copy each propertes of the three components to components in page2

if you want to reuse a layer on page1, Import component layer will work for you. This copy & paste is just to copy values of component properties to another layer

An action can be copied to another page, make sure each command in the action should be linked to a valid layer in the pasted page. For instance action with play animation can be copied to another page, so the pasted page should have an animation() with the same name to play. You may modify playAnimation() argument to assign a different layer animation in the pasted page.

page1

  • layer animation 1A
  • acion 1B
  • layer button 1C
  1. make an animaton for a layer – 1A

    1. select a layer

    2. click Animation icon > linear

    3. animation props

      • wait for an action
  2. make an action – 1B

    1. click Action icon
    2. selec Animation command
      • play animation 1A
  3. make a button – 1C

    1. select a layer
    2. click interaction > button
      • onTap to dispatch B

page2

  • layer 2A
  • (action 2B)
  • layer 2C
  1. copy the layer animation 1A on page1, and paste to layer 2A

  2. copy the action 1B on page1, and paste to page2

  3. copy the layer button 1C on page1, and paste it to layer 2C

graph TB

subgraph page1

animation ---|with wait|layer1A
subgraph action1B
  playAnimation
end

playAnimation -.-> animation

button --- layer1C

button -. dispatch tap .-> action1B

end
graph LR

subgraph page1
action1B
animation
button
end

subgraph page2
layer2A
action2B
layer2C
end

style action2B fill:#bbf,stroke:#fff,stroke-width:2px,color:#fff,stroke-dasharray: 5 5

animation -.copy & paste to layer2A .-> layer2A
button -. copy & paste to layer2C .-> layer2C
action1B -. copy & paste to page2, rename it to action2B .-> page2

Manually change the play aniamtion argument

  • action2B in page2
    • play Animation
      • layer1A-animation <=== should be changed to layer2A-animation

copy & paste a component allowed from page to page

  • audios

  • groups

  • timers

  • variables

  • actions

  • properties

    • layer

    • layer’ class

      • animations
      • interactions
      • replacements
      • physics
    • page