One of the powerful features of Flowcode is the ability to clone panel primitive and other components. An example of this in action is the WS2811 component that generates the chained together LEDs on the panel in 1D, 2D and 3D matrices and allows for powerful simulation capabilities.
I've recently made a small demo program to show how to take a component and clone it a number of times and then how to access the properties of the cloned components.
The demo siply takes a hidden static text component named "Clone" and uses this as the master for the clone. All of the features of the component are copied into the clones including the current property settings and location on the panel. The clones are made visible and moved to create a vertical list of static text components. The clones are rebuilt whenever a property change event occurs e.g. changing the number of clone items.
In the main macro the static text clones are provided a randomised text value to demonstrate controlling the properties of the clones. This could be the colour of a primitive or any other component property.
Debug information is available via the Component Debugger window when the debug property is set to Yes. This simply highlights how the DeleteClones and GenerateClones component macros function.
You cannot call the component macros of the cloned items just yet so it won't work for everything but hopefully this will prove useful for some component creation ideas.
1 post • Page 1 of 1