SpeedControl
MEMBERS
-
name :string
-
Name of SpeedControl
Example:
// Objective: Get the name of an AppEvent. // Expected Result: The console should read "myAppEvent name keyboardEvent". // Get an instance of the keyboardEvent (AppEventWithFocus) AppEvent. let myAppEvent = nc.appEvents.keyboardEvent; console.log("myAppEvent name", myAppEvent.name);
-
speed :number
-
The speed value. This value multiplies the speed of processes that subscribe to this SpeedControl
- Default Value:
- 1
Example:
// Objective: Adjust the motion speed of a "bouncing" white box. // Expected Result: The white box will bounce, gradually slowing down over a period of 5 seconds, then it will gradually speed back up over a period of 5 seconds. // Create a GraphicObject using the white box GraphicAsset and add it to the main Scene. let myGraphicObject = new GraphicObject( nc.graphicAssets.whiteBox, nc.mainScene, "MyGraphicObject" ); // Give the box motion along the y axis. Set the speed to 2. myGraphicObject.position.addMotion.y(-300,300,2); // Swoop the 'speed' property of the MainSpeedControl down to .05 over a period of 5 seconds and provide callback arguments to swoop the 'speed' property again back up to speed 1 over a period of 10 seconds. nc.swoopValue( nc.speedControls.MainSpeedControl, "speed", .05, 5, undefined, nc, "swoopValue", [nc.speedControls.MainSpeedControl, "speed", 1, 10] );
-
readonly type :string
-
Type identifier