Z.every(...)
Studio is being deprecated, please head over to the documentation page for Mattercraft, our most advanced 3D tool for the web, where you can find the most recent information and tutorials.
Z.every(ms: number, func: () => void): void;
Runs a function repeatedly after the specified time has passed. This may occur some number of milliseconds beyond the specified interval due to variable frame times.
This repeating function call can be stopped by calling Z.everyOff(…).
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
ms | number | The number of milliseconds that must have elapsed before the function will be called each time. |
func | function | The function to be called every time the interval has elapsed. |
Example
Section titled “Example”function myRepeatingFunction() { //a function to repeatedly call}//call myRepeatingFunction every 2000ms (2 seconds)Z.every(2000, myRepeatingFunction);