What is Incisor?
Tutorials
Key Concepts
Reddit
Stack Overflow
Deprecation Schedule

UiStringSupervisor_textField(parent (opt), name (opt)) extends UiTextField

A specialized UiTextField that includes a Superivor member, enabling it to monitor and adjust a string property's value during runtime. To use this class, configure the 'supervisedPropertyGetter' and 'supervisedPropertySetter' callbacks on the Supervisor. Once configured, the 'mainText' TextBox will be updated every fixed update to reflect the most current value of the supervised property, and the value of the supervised property will also be 'adjustable' via direct editing of the 'mainText' TextBox. [REQUIREMENT: optional code module - 'extendedUi']

new UiStringSupervisor_textField(parent (opt), name (opt))

A specialized UiTextField that includes a Superivor member, enabling it to monitor and adjust a string property's value during runtime. To use this class, configure the 'supervisedPropertyGetter' and 'supervisedPropertySetter' callbacks on the Supervisor. Once configured, the 'mainText' TextBox will be updated every fixed update to reflect the most current value of the supervised property, and the value of the supervised property will also be 'adjustable' via direct editing of the 'mainText' TextBox. [REQUIREMENT: optional code module - 'extendedUi']

Parameters:
Name Type Attributes Default Description
parent SceneObject <optional>
 

The SceneObject that will become the new UiStringSupervisor_textField's parent in the Scene hierarchy. [DEFAULT: nc.mainScene]

name string <optional>
 

The name of the new UiStringSupervisor_textField. [DEFAULT: 'UiStringSupervisor_textField']

MEMBERS

readonly supervisor :Supervisor

Supervisor with callbacks that enable this UiStringSupervisor_textField to monitor and adjust a string property's value during runtime.

Members below are inherited from the parent class.

buttonBackgroundColor :Color

The Color of the Button background.

Inherited From:

Default Value:
  • nc.uiStyle.color_buttonPanel

children :Array.<SceneObject>

The the array of this SceneObject's children SceneObjects in the hierarchy.

Inherited From:

Example:
// Objective: Add children to a SceneObject.
// Expected Result: The console log should read "children count 2".

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Add 2 GraphicObjects to the SceneObject using the GraphicObject constructor.
new GraphicObject( nc.graphicAssets.WhiteBox, this.mySceneObject, "WhiteBox" );
new GraphicObject( nc.graphicAssets.WhiteTriangle, this.mySceneObject, "WhiteTriangle" );
console.log("children count", mySceneObject.children.length); 

colorMultiply :Color

The EffectController for the 'ColorMultiply' EffectNode, which multiplies the red, green, blue, and alpha color values of the Material it is applied to.

Inherited From:

readonly containingScene :Scene

The Scene in which this SceneObject resides.

Inherited From:

Example:
// Objective: Determine the containing scene of a SceneObject.
// Expected Result: The console should have 2 log messages as follows:
//    The containing scene for 'MyMainSceneObject' is MainScene
//    The containing scene for 'MyOtherSceneObject' is MyScene

// Create a SceneObject using the SceneObject constructor. This will add "MyMainSceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MyMainSceneObject" );
console.log("The containing scene for 'MyMainSceneObject' is", mySceneObject.containingScene.name);

// Create a new Scene and name it "MyScene".
let myScene = new Scene("MyScene");
// Create a SceneObject using the SceneObject constructor. This will add "MyOtherSceneObject" to myScene ("MyScene").
let myOtherSceneObject = new SceneObject( myScene, "MyOtherSceneObject" );
console.log("The containing scene for 'MyOtherSceneObject' is", myOtherSceneObject.containingScene.name);

displayLabel :boolean

Boolean determining if a label TextBox is displayed to the left of the UiTextField.

Inherited From:

elementSpacer :number

Number corresponding to the amount of space between each element in the LayoutStack. For LayoutStacks with standardUiZoomFunctionality enabled, this these spaces will be scaled by nc.uiZoom.totalZoom.

Inherited From:

Default Value:
  • 0

enabled :boolean

Boolean determining if this SceneObject is enabled. Enabled SceneObjects are shown normally within the Scene while disabled SceneObjects are not shown. If a SceneObject is disabled, all of its children inherit its disabled state, but if it is enabled all of its childrens' states depend on their own 'enabled' properties.

Inherited From:

Default Value:
  • true
Example:
// Objective: Disable a SceneObject to disable its children.
// Expected Result: You do not see the white box.

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Add a GraphicObject to the SceneObject using the GraphicObject constructor.
new GraphicObject( nc.graphicAssets.WhiteBox, mySceneObject, "WhiteBox" );
// Set mySceneObject to enabled = false.
mySceneObject.enabled = false;

fillColor :Color

The EffectController for the 'FillColor' EffectNode, which entirely fills the associated Geometry with the red, green, blue, and alpha color values provided.

Inherited From:

focusFallback :SceneObject

Sets up a 'focus fallback' for this SceneObject. Once set, if 'nc.relinquishFocus' is called while this SceneObject is focused, then the fallback object will automatically become the new focused object.

Inherited From:

Default Value:
  • nc.defaultFocusFallback

readonly hierarchyDepth :number

Number indicating how many ancesters this SceneObject has.

Inherited From:

Example:
// Objective: Retrieve the hierarchy depth of a SceneObject.
// Expected Result: The console log should read "myGraphicObject2 hierarchy depth is 3".

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject1" to the SceneObject.
let myGraphicObject1 = new GraphicObject( nc.graphicAssets.WhiteBox, mySceneObject, "GraphicObject1" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject2" to the GraphicObject myGraphicObject1 (GraphicObject1). 
let myGraphicObject2 = new GraphicObject( nc.graphicAssets.WhiteTriangle, myGraphicObject1, "GraphicObject2" );
// Console log the hierarchy depth of myGraphicObject2 ("GraphicObject2").
console.log("myGraphicObject2 hierarchy depth is", myGraphicObject2.hierarchyDepth);

highlightedButtonBackgroundColor :Color

The Color of the Button background when it's highlighted.

Inherited From:

Default Value:
  • nc.uiStyle.color_highlightedButtonPanel

inheritedTypes :object

Dictionary object listing all of the types this object is compatible with.

Inherited From:

Example:
// Objective: Determine the inherited types of a Button.
// Expected Result: The console log should read "inherited types {"SceneObject":true,"GraphicObject":true,"Button":true}".

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Add a Button named "MyButton" to the SceneObject.
let myButton = new Button( nc.graphicAssets.WhiteBox, mySceneObject, "MyButton" );
console.log("inherited types", JSON.stringify( myButton.inheritedTypes ) );

isActive :boolean

Boolean determining if the UiTextField is available for end-user-internaction, or if it is unavailable and 'grayed out'.

Inherited From:

Default Value:
  • true

readonly isEnabledWithInheritance :boolean

Boolean that reflects if the overall state of this SceneObject is 'enabled', incorporating the state of its anscesters.

Inherited From:

Example:
// Objective: Use isEnabledWithInheritance to determine the enabled value at various levels of the heirarchy.
// Expected Result: The console should have 2 log messages as follows:
//   Top level scene object, enabled is true
//   Bottom level scene object, enabled is false

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject1" to the SceneObject.
let myGraphicObject1 = new GraphicObject( nc.graphicAssets.WhiteBox, mySceneObject, "GraphicObject1" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject2" to the GraphicObject myGraphicObject1 (GraphicObject1). 
let myGraphicObject2 = new GraphicObject( nc.graphicAssets.WhiteTriangle, myGraphicObject1, "GraphicObject2" );

// Set myGraphicObject1 to enabled = false. ("GraphicObject1").
myGraphicObject1.enabled = false;
// Console log the isEnabledWithInheritance value of the top level SceneObject ("MySceneObject").
console.log("Top level scene object, enabled is", mySceneObject.isEnabledWithInheritance); // true
// Console log the isEnabledWithInheritance value of the bottom level SceneObject ("GraphicObject2").
console.log("Bottom level scene object, enabled is", myGraphicObject2.isEnabledWithInheritance); // false

isVertical :boolean

Flag that determines if this LayoutStack is a vertical stack organized from top to bottom or a horizontal stack organzied from left to right.

Inherited From:

Default Value:
  • true

label :UiText

A TextBox that acts as a label for the UiTextField.

Inherited From:

layoutObject :LayoutObject

Object housing information about this particular SceneObject's LayoutObject functionality. LayoutObject functionality applies to SceneObjects that have been added as elements to a LayoutStack, which is responsible for organizing visual content (TextBoxes, Graphics, Buttons, etc...) into dynamic vertical or horizontal stacks. Until a SceneObject has been configured with LayoutObject functionality (either by calling 'SceneObject.configureLayoutObject' or by adding the SceneObject as an element to a LayoutStack), the 'SceneObject.layoutObject' member will be undefined. [NON-INSTANTIABLE]

Inherited From:

Example:
// Objective: Configure a layout object.
// Expected Result: The console should read "layout object width and height after configuration: 20 10".

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
this.mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );

// Add a callback function.
this.myCallback = function(args) {
    // return a Vector2 with a width of 20 and a height of 10
    return new Vector2( 20, 10 ); 
}

// Add a reference to a callback function passing the owner of the function and the function name.
this.mySceneObject.configureLayoutObject( this, "myCallback" );
console.log('layout object width and height after configuration:', this.mySceneObject.layoutObject.width, this.mySceneObject.layoutObject.height);

mainButton :Button

The main Button for the UiTextField, this object is a UiPanel which also implements Button.

Inherited From:

mainText :TextBox

The main editable TextBox for this UiTextField.

Inherited From:

minHeight :number

Optional minimum height for this LayoutStack.

Inherited From:

Default Value:
  • 0

minWidth :number

Optional minimum width for this LayoutStack.

Inherited From:

Default Value:
  • 0

name :string

The name of the SceneObject.

Inherited From:

Default Value:
  • 'SceneObject'
Example:
// Objective: Set and Get the name of a SceneObject.
// Expected Result: The console should have 2 log messages as follows:
//    original name is MySceneObject
//    new name is MyDifferentSceneObject
 
// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
console.log("original name is", mySceneObject.name );
// Update the name of the SceneObject.
mySceneObject.name = "MyDifferentSceneObject";
console.log("new name is", mySceneObject.name );

outline :UiOutline

The outline of the button, which is used to indicate when the end-user outlines this UiTextField using keyboard navigation (tab, arrows, etc...).

Inherited From:

parent :SceneObject

The SceneObject that is this SceneObject's parent in the hierarcy. If this SceneObject is of type 'Scene', this value is left undefined. Set this property to change the parent of this SceneObject, or use 'SceneObject.setParent' to do the same thing but with the 'maintainGlobalPostion' optional parameter.

Inherited From:

Example:
// Objective: Get the parent of a scene object.
// Expected Result: The console log should read "parent name is MySceneObject".

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Add a GraphicObject to the SceneObject using the GraphicObject constructor.
let myGraphicObject = new GraphicObject( nc.graphicAssets.WhiteBox, this.mySceneObject, "WhiteBox" );
// Console log the parent name of this GraphicObject.
console.log("parent name is", myGraphicObject.parent.name);

pivotPoint :Vector2

The pivot point for the LayoutStack, with [0,0] meaning center pivot, and [.5,.5] meaning right-top pivot. LayoutStacks are center-based by default like to most GraphicObjects. It should be noted that pivotPoint and justification seperate concepts and do not affect eachother. Justification affects the alignment of the content within the bounds of the LayoutStack, and pivotPoint affects where the 'origin' of the LayoutStack is relative to those bounds.

Inherited From:

Default Value:
  • new Vector2(-.5,.5)

position :Vector3

The position of this SceneObject relative to it's parent.

Inherited From:

Default Value:
  • new Vector3(0,0,0)
Example:
// Objective: Move the position of the "WhiteTriangle" relative to the "WhiteBox".
// Expected Result: The "WhiteTriangle" is 300 world units above and 300 world units to the right of the "WhiteBox".

// Note: To use a custom graphic, add your image file to the assets directory and access it using nc.graphicAssets['MyImage']

// Add a GraphicObject to the main scene using the GraphicObject constructor.
new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "WhiteBox" );
// Add another GraphicObject to the main scene using the GraphicObject constructor, this time using the WhiteTriangle GraphicAsset.
let whiteTriangleGraphicObject =  new GraphicObject( nc.graphicAssets.WhiteTriangle, nc.mainScene, "WhiteTriangle" );
// Update the position of the "WhiteTriangle", moving it 300 world units above and 300 world units to the right of the "WhiteBox".
whiteTriangleGraphicObject.position.x = 300;
whiteTriangleGraphicObject.position.y = 300;

rotation :Vector3

The rotation (in degrees) of this SceneObject relative to it's parent. Positive values correspond to counter-clockwise rotation around the given axis.

Inherited From:

Default Value:
  • new Vector3(0,0,0)
Example:
// Objective: Create a SceneObject with a graphic and rotate it.
// Expected Result: The white box has rotated 45 degrees into a diamond shape.

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Add a GraphicObject to the SceneObject using the GraphicObject constructor.
// Note: To use a custom graphic, add your image file to the assets directory and access it using nc.graphicAssets['MyImage']
new GraphicObject( nc.graphicAssets.WhiteBox, mySceneObject, "MyGraphicObject" );
// Rotate the SceneObject 45 degrees around the z axis.
mySceneObject.rotation.z = 45;

scale :Vector3

The scale of this SceneObject relative to it's parent.

Inherited From:

Default Value:
  • new Vector3(1,1,1)
Example:
// Objective: Using the scale property, increase the size of a GraphicObject.
// Expected Result: You will see a blue box in the center of the screen and a larger red box, now in the shape of a rectangle, to the right of it.

// Note: To use a custom graphic, add your image file to the assets directory and access it using nc.graphicAssets['MyImage']

// Add a GraphicObject to the main scene using the GraphicObject constructor. 
let blueBox = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "BlueBox" );
// Use fillColor to make it blue.
blueBox.fillColor = new Color( 0, 0, 1, 1 ); // blue

// Add another GraphicObject to the main scene using the GraphicObject constructor.
let redBox = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "RedBox" );
// Use fillColor to make it red.
redBox.fillColor = new Color( 1, 0, 0, 1 ); // red
// Use position to move the red box to the right 500 world units.
redBox.position.x = 500;
// Use scale to make the red box a larger rectangle 
redBox.scale.x = 2;
redBox.scale.y = 4;

shapify :shapify

The EffectController for the 'Shapify' EffectNode. The Shapify EffectNode converts edge data stored in a 'shapified' Texture into a presentable image with edges that stay sharp regardless of the scale of the associated GraphicObject. This is an instance of a dynamically defined EffectController with base type 'Vector2'. To get a new instance, use 'nc.effectControllers['shapify'].new'shapify()'.

Inherited From:

snapToNearestWorldPosition :boolean

Flag that determines if this SceneObject's global position is always snapped to the nearest integer (for x and y only). This property is mainly used to help provide pixel-perfect rendering for TextBoxes, see 'TextBox.useNearestPixelRendering' for more information.

Inherited From:

Default Value:
  • false

type :string

Type identifier.

Inherited From:

Example:
// Objective: Determine the type of a SceneObject
// Expected Result: The console should have 3 log messages as follows:
//   MySceneObject is of type SceneObject
//   MyGraphicObject is of type GraphicObject
//   MyButton is of type Button

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Create a GraphicObject using the GraphicObject constructor adding it to "mySceneObject".
let myGraphicObject = new GraphicObject( nc.graphicAssets.WhiteBox, mySceneObject, "MyGraphicObject" );
// Create a Button using the Button constructor and adding it to myGraphicObject.
let myButton = new Button( nc.graphicAssets.WhiteTriangle, myGraphicObject, "MyButton" );

console.log(mySceneObject.name + ' is of type ' + mySceneObject.type);
console.log(myGraphicObject.name + ' is of type ' + myGraphicObject.type);
console.log(myButton.name + ' is of type ' + myButton.type);

uiKeyboardNavigable :UiKeyboardNavigable

Object housing functionality that enables for this SceneObject to be accessible via keyboard navigation. Keyboard navigation enables the end-user to press the arrow keys, tab, space, and enter keys to outline and trigger any 'uiKeyboardNavigable' SceneObjects within a UiKeyboardNavigator-enabled parent that is currently 'in focus' according to 'nc.singularFocusObject'. This property defaults to undefined, but can be enabled, by calling 'SceneObject.configureUiKeyboardNavigable()'. [NON-INSTANTIABLE] [REQUIREMENT: optional code module - 'extendedUi']

Inherited From:

uiKeyboardNavigator :UiKeyboardNavigator

Object housing functionality that enables for keyboard navigation of this SceneObject's ui-related descendants. Keyboard navigation enables the end-user to press the tab, space, and enter keys to outline and trigger any 'uiKeyboardNavigable' descendants of the SceneObject owning this UiKeyboardNavigator when it is 'in focus' according to 'nc.singularFocusObject'. This property defaults to undefined, but can be enabled, by calling 'SceneObject.configureUiKeyboardNavigator()'. [NON-INSTANTIABLE] [REQUIREMENT: optional code module - 'extendedUi']

Inherited From:

uiVisualFocus :UiVisualFocus

Object housing functionality that enables for the SceneObject owning it to be 'visually focused', which focuses the end-user's attention the given SceneObject by placing it in front of a dimmer layer whenever the object is the the current 'singularFocusObject'. Calling 'configureUiVisualFocus' populates the 'uiVisualFocus' member for the owning SceneObject. It should be noted that the dimmer layer that the newly focused item is placed in front of is actually a button which, when pressed, calls the 'attemptExitUiVisualFocus' member of the current singularFocusObject if that member is defined. [NON-INSTANTIABLE] [REQUIREMENT: optional code module - 'extendedUi']

Inherited From:

METHODS

Methods below are inherited from the parent class.

addDisposalCallback(callbackOwner, callbackName, callbackArgs (opt))

Adds a callback function to the list of callbacks that occur when this SceneObject is disposed.

Parameters:
Name Type Attributes Default Description
callbackOwner object  

The object owning the callback function that is called when this SceneObject is disposed.

callbackName string  

The name of the function that is called when this SceneObject is disposed.

callbackArgs Array | any <optional>
 

Arguments for the function that is called when this SceneObject is disposed.

Inherited From:

Example:
// Objective: Add a 'Disposal' callback.
// Expected Result: The console should read "disposal callback: myDisposalData".

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
this.mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );

// Add a callback function.
this.myCallback = function(args) {
   console.log('disposal callback:', args);
}

// Add a reference to a callback function passing the owner of the function, the function name, and any additional data we want.
this.mySceneObject.addDisposalCallback( this, "myCallback", ["myDisposalData"] );
// Call dispose() on mySceneObject. This will fire a disposal callback.
this.mySceneObject.dispose();

addEffectNodes(effectNodes, alsoAddToDescendants (opt))

Adds the given EffectNodes to the Materials associated with this SceneObject. EffectNodes are GPU-driven visual effects assigned to SceneObjects, GraphicObjects, and ultimately Materials. Each EffectNode can be manipulated dynamically by one or more EffectControllers, which are accessable as direct members of the given SceneObject or Material. When a GraphicObject is set to a particular GraphicAsset, it's Materials adopt the GraphicAsset's EffectNode and EffectController presets by default, but they can be customized at any time.

Parameters:
Name Type Attributes Default Description
effectNodes Array.<EffectNode> | EffectNode  

The EffectNodes to add to this SceneObject and its Materials.

alsoAddToDescendants boolean <optional>
true

Boolean determining if the given EffectNodes will also be added to the SceneObject's descendants' Materials. [DEFAULT: true]

Inherited From:

addElements(elements, index (opt))

Adds the specified SceneObject(s) as elements to the LayoutStack. Please note that SceneObjects added to LayoutStacks are re-assigned to be children of that LayoutStack. If an added SceneObject has not yet been configured with LayoutObject functionality, the standard LayoutObject configuration will be applied. The LayoutObject configuration of any SceneObject can be customized by calling 'SceneObject.configureLayoutObject' before adding it to a LayoutStack. The LayoutObject configuration is a means by which a LayoutStack can determine the layout dimensions of its elements, inform the elements to refresh their layouts, and be informed by elements to update its layout due to a change in dimensions of the elements.

Parameters:
Name Type Attributes Default Description
elements SceneObject | Array.<SceneObject>  

The SceneObject(s) to add as elements to the LayoutStack.

index number <optional>
 

Optional index enabling inserting elements in locations other than at the end of the elements list. [DEFAULT: (pushed to end)]

Inherited From:

addEnabledStateChangeCallback(callbackOwner, callbackName, callbackArgs (opt))

Adds a callback function to the list of callbacks that occur whenever the state of this SceneObject's 'enabled' property changes. The true/false enabled state is sent to the callback as its first paremeter, followed by any 'callbackArgs' provided.

Parameters:
Name Type Attributes Default Description
callbackOwner object  

The object owning the callback function that is called when this SceneObject's enabled state changes.

callbackName string  

The name of the function that is called when this SceneObject's enabled state changes.

callbackArgs Array | any <optional>
 

Arguments for the function that is called when this SceneObject's enabled state changes.

Inherited From:

Example:
// Objective: Add an 'Enabled State Change' callback.
// Expected Result: The console should have 2 log messages as follows:
//    enabled state is false
//    enabled state is true

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
this.mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );

// Add a callback function.
this.myCallback = function(args) {
   console.log('enabled state is', args);
}

// Add a reference to a callback function passing the owner of the function and the function name.
this.mySceneObject.addEnabledStateChangeCallback( this, "myCallback" );
// Set mySceneObject to enabled = false. This will fire an enabled state change callback.
this.mySceneObject.enabled = false;
// Set mySceneObject to enabled = true. This will fire an enabled state change callback.
this.mySceneObject.enabled = true;

addSpacerElement(spacerWidth, spacerHeight, index (opt))

Adds a blank element as a spacer between other elements. For LayoutStacks with standardUiZoomFunctionality enabled, this these spacers will be scaled by nc.uiZoom.totalZoom.

Parameters:
Name Type Attributes Default Description
spacerWidth number  

The width (in world units) of the spacer to add.

spacerHeight number  

The height (in world units) of the spacer to add.

index number <optional>
 

Optional index enabling inserting spacers in locations other than at the end of the elements list. [DEFAULT: (pushed to end)]

Inherited From:

addTriggerCallback(callbackOwner, callbackName, callbackArgs (opt))

Adds a callback that occurs whenever this UiTextField is triggered via the cursor or keyboard navigation. The triggering browser-created event, and the UiTextField itself are sent to the callback as its first two parameters.

Parameters:
Name Type Attributes Default Description
callbackOwner object  

The object owning the callback function that occurs whenever this UiTextField is triggered via the cursor or keyboard navigation.

callbackName string  

The name of the callback function that occurs whenever this UiTextField is triggered via the cursor or keyboard navigation.

callbackArgs Array | any <optional>
 

Args for the callback function that is triggered whenever this UiTextField is triggered via the cursor or keyboard navigation.

Inherited From:

clear(dispose (opt))

Clears all of the elements from the LayoutStack

Parameters:
Name Type Attributes Default Description
dispose boolean <optional>
 

Boolean determining if cleared elements are also disposed. [DEFAULT: true]

Inherited From:

configureLayoutObject(refreshLayoutCallbackOwner, refreshLayoutCallbackName, refreshLayoutCallbackArgs)

Function to configure the SceneObject with LayoutObject functionality, which prepares it to be added as an element to a LayoutStack. Once configured, the configuration information can be found (and adjusted if necessary) in the SceneObject.layoutObject. Most SceneObject-inheriting objects have standard LayoutObject functionality that is automatically configured when they are added as elements to a LayoutStack, so this method is mainly for creating custom LayoutObject functionality. Configuration consists of supplying a callback to a user-defined function that refreshes the layout of the SceneObject in question and returns a Vector2 containing the resulting dimensions.

Parameters:
Name Type Attributes Default Description
refreshLayoutCallbackOwner object    

The object owning the callback function that is called by the LayoutStack containing this LayoutObject when the layout is refreshed.

refreshLayoutCallbackName string    

The name of the callback function that is called by the LayoutStack containing this LayoutObject when the layout is refreshed.

refreshLayoutCallbackArgs Array | any    

Arguments for the callback function that is called by the LayoutStack containing this LayoutObject when the layout is refreshed.

Inherited From:

Example:
// Objective: Configure a layout object.
// Expected Result: The console should read "layout object width and height after configuration: 20 10".

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
this.mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );

// Add a callback function.
this.myCallback = function(args) {
    // return a Vector2 with a width of 20 and a height of 10
    return new Vector2( 20, 10 ); 
}

// Add a reference to a callback function passing the owner of the function and the function name.
this.mySceneObject.configureLayoutObject( this, "myCallback" );
console.log('layout object width and height after configuration:', this.mySceneObject.layoutObject.width, this.mySceneObject.layoutObject.height);

configureUiKeyboardNavigable(setOutlineCallbackOwner, setOutlineCallbackName, triggerCallbackOwner, triggerCallbackName)

Function to configure the SceneObject with UiKeyboardNavigable functionality, which enables the end-user access the SceneObject using keyboard navigation.
Calling 'configureUiKeyboardNavigable' populates the 'uiKeyboardNavigable' member for the owning SceneObject.

Parameters:
Name Type Attributes Default Description
setOutlineCallbackOwner object    

The owner of the callback that occurs whenever keyboard navigation changes the 'outline' state of the UiKeyboardNavigable object. The outline state will be sent to the callback as its first parameter.

setOutlineCallbackName string    

The name of the callback that occurs whenever keyboard navigation changes the 'outline' state of the UiKeyboardNavigable object. The outline state will be sent to the callback as its first parameter.

triggerCallbackOwner object    

The owner of the callback that occurs whenever keyboard navigation triggers the UiKeyboardNavigable object via the spacebar or enter keys.

triggerCallbackName string    

The name of the callback that occurs whenever keyboard navigation triggers the UiKeyboardNavigable object via the spacebar or enter keys

Inherited From:

configureUiKeyboardNavigator()

Function to configure the SceneObject with UiKeyboardNavigator functionality, which enables the end-user to press the tab, space, and enter keys to outline and trigger any 'uiKeyboardNavigable' descendants of the SceneObject owning this UiKeyboardNavigator when it is 'in focus' according to 'nc.singularFocusObject'. Calling 'configureUiKeyboardNavigator' populates the 'uiKeyboardNavigator' member for the owning SceneObject.

Inherited From:

configureUiVisualFocus()

Function to configure the SceneObject with UiVisualFocus functionality, which focuses the end-user's attention on the given SceneObject by placing it in front of a dimmer layer whenever the object is the the current 'singularFocusObject'. Calling 'configureUiVisualFocus' populates the 'uiVisualFocus' member for the owning SceneObject. It should be noted that the dimmer layer that the newly focused item is placed in front of is actually a button which, when pressed, calls the 'attemptExitUiVisualFocus' member of the current singularFocusObject if that member is defined.

Inherited From:

disable()

Sets this SceneObject's 'enabled' value to false.

Inherited From:

Example:
// Objective: Call disable() on a previously enabled SceneObject.
// Expected Result: The console should read "enabled state is false".

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
this.mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );

// Add a callback function.
this.myCallback = function(args) {
    console.log('enabled state is', args);
}

// Add a reference to a callback function passing the owner of the function and the function name.
this.mySceneObject.addEnabledStateChangeCallback( this, "myCallback" );
// By default, the SceneObject is already enabled. Call disable() on mySceneObject. This will fire an enabled state change callback.
this.mySceneObject.disable();

dispose()

Removes this SceneObject and its descendants from the hierarchy, and removes internal Incisor® references to aid memory management.

Inherited From:

Example:
// Objective: Call dispose() on a SceneObject.
// Expected Result: The console should have 2 log messages as follows:
//    descendants before disposal 3
//    after wait descendants after disposal 1 

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject1" to the SceneObject.
let myGraphicObject1 = new GraphicObject( nc.graphicAssets.WhiteBox, mySceneObject, "GraphicObject1" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject2" to myGraphicObject1.
let myGraphicObject2 = new GraphicObject( nc.graphicAssets.WhiteTriangle, myGraphicObject1, "GraphicObject2" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject3" to myGraphicObject2.
let myGraphicObject3 = new GraphicObject( nc.graphicAssets.WhiteTriangle, myGraphicObject2, "GraphicObject3" );

// Log the number of descendants of mySceneObject before calling dispose().
console.log( "descendants before disposal", mySceneObject.getDescendants().length );
// Call dispose() on myGraphicObject2.
myGraphicObject2.dispose();

// The call to dispose() can take some time to complete so lets wait 2 seconds before we log again.

// Create a callback function to log the descendants after calling dispose().
this.myWait = function() {
    console.log( "after wait descendants after disposal", mySceneObject.getDescendants().length );
}
// Using nc.WaitThen, wait 2 seconds before attempting to log the descendants again.
nc.waitThen( 2, this, "myWait" );

enable()

Sets this SceneObject's 'enabled' value to true.

Inherited From:

Example:
// Objective: Call enable() on a previously disabled SceneObject.
// Expected Result: The console should have 2 log messages as follows:
//    enabled state is false
//    enabled state is true

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
this.mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );

// Add a callback function.
this.myCallback = function(args) {
    console.log('enabled state is', args);
}

// Add a reference to a callback function passing the owner of the function and the function name.
this.mySceneObject.addEnabledStateChangeCallback( this, "myCallback" );
// Set the enabled state of mySceneObject to false.
this.mySceneObject.enabled = false;
// Call enable() on mySceneObject. This will fire an enabled state change callback.
this.mySceneObject.enable();

getAncestors() returns {Array.<SceneObject>}

Returns a list of this SceneObject's ancesters.

Returns:
Array.<SceneObject>
Inherited From:

Example:
// Objective: Get the ancestors of a SceneObject.
// Expected Result: The console should have 2 log messages as follows:
//    myGraphicObject3 ancestors count 4
//    myGraphicObject1 ancestors count 2

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject1" to the SceneObject.
let myGraphicObject1 = new GraphicObject( nc.graphicAssets.WhiteBox, mySceneObject, "GraphicObject1" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject2" to the GraphicObject myGraphicObject1 (GraphicObject1). 
let myGraphicObject2 = new GraphicObject( nc.graphicAssets.WhiteTriangle, myGraphicObject1, "GraphicObject2" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject3" to the GraphicObject myGraphicObject2 (GraphicObject2). 
let myGraphicObject3 = new GraphicObject( nc.graphicAssets.WhiteTriangle, myGraphicObject2, "GraphicObject3" );
// Console log the ancestors count.
console.log( "myGraphicObject3 ancestors count", myGraphicObject3.getAncestors().length );
console.log( "myGraphicObject1 ancestors count", myGraphicObject1.getAncestors().length );

getDescendants(enabledOnly, includeEnclosedScenes) returns {Array.<SceneObject>}

Returns a list of this SceneObject's descendants.

Parameters:
Name Type Attributes Default Description
enabledOnly boolean    

Boolean determining if only enabled SceneObjects are added to the returned list. [DEFAULT: true]

includeEnclosedScenes boolean    

Boolean determining if sub-descendants of ScrollingPanels' Scenes will be included in the returned list. [DAFAULT: false]

Returns:
Array.<SceneObject>
Inherited From:

Example:
// Objective: Get the descendants of a SceneObject.
// Expected Result: The console should have 2 log messages as follows:
//    myGraphicObject3 descendants count 0
//    myGraphicObject1 descendants count 2

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
let mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject1" to the SceneObject.
let myGraphicObject1 = new GraphicObject( nc.graphicAssets.WhiteBox, mySceneObject, "GraphicObject1" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject2" to the GraphicObject myGraphicObject1 (GraphicObject1). 
let myGraphicObject2 = new GraphicObject( nc.graphicAssets.WhiteTriangle, myGraphicObject1, "GraphicObject2" );
// Using the GraphicObject constructor, add a GraphicObject named "GraphicObject3" to the GraphicObject myGraphicObject2 (GraphicObject2). 
let myGraphicObject3 = new GraphicObject( nc.graphicAssets.WhiteTriangle, myGraphicObject2, "GraphicObject3" );
// Console log the descendants count.
console.log( "myGraphicObject3 descendants count", myGraphicObject3.getDescendants().length );
console.log( "myGraphicObject1 descendants count", myGraphicObject1.getDescendants().length );

getElements() returns {Array.<SceneObject>}

Returns a shallow copy of the current array of elements.

Returns:
Array.<SceneObject>
Inherited From:

getGlobalPosition(returnVector3 (opt)) returns {Vector3}

Returns a Vector3 with the global position of this SceneObject within the Scene.

Parameters:
Name Type Attributes Default Description
returnVector3 Vector3 <optional>
 

Optional Vector3 that can be supplied to avoid the generation of a new Vector3 object for efficiency.

Returns:
Vector3
Inherited From:

Example:
// Objective: Get the global position of a SceneObject.
// Expected Result: 'InnerSceneObject' global position x,y 200 200

// Create a new Scene and name it "MyScene".
let myScene = new Scene("MyScene");
// Create a SceneObject using the SceneObject constructor. This will add "OuterSceneObject" to "MyScene".
let outerSceneObject = new SceneObject( myScene, "OuterSceneObject" );
// Create a SceneObject using the SceneObject constructor. This will add "InnerSceneObject" to "OuterSceneObject".
let innerSceneObject = new SceneObject( outerSceneObject, "InnerSceneObject" );
// Update the position of the outerSceneObject, moving it up and to the right, 100 world units.
outerSceneObject.position.x = 100;
outerSceneObject.position.y = 100;   
// Update the position of the innerSceneObject, moving it up and to the right, 100 world units.
innerSceneObject.position.x = 100;
innerSceneObject.position.y = 100;  
// Console log the x and y of mySceneObject using getGlobalPosition(). 
console.log( "'InnerSceneObject' global position x,y", innerSceneObject.getGlobalPosition().x, innerSceneObject.getGlobalPosition().y );

getGlobalScale(returnVector3 (opt)) returns {Vector3}

Returns a Vector3 with the global scale of this SceneObject within the Scene.

Parameters:
Name Type Attributes Default Description
returnVector3 Vector3 <optional>
 

Optional Vector3 that can be supplied to avoid the generation of a new Vector3 object for efficiency.

Returns:
Vector3
Inherited From:

Example:
// Objective: Get the global scale of a SceneObject.
// Expected Result: The console should read "scale x,y 2 2.
   
// Add a GraphicObject to the main scene using the GraphicObject constructor. 
let whiteBox = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "WhiteBox" );
// Use scale to make the "WhiteBox" twice as large
whiteBox.scale.x = 2;
whiteBox.scale.y = 2;

console.log( "scale x,y", whiteBox.getGlobalScale().x, whiteBox.getGlobalScale().y );

getViewPosition(camera, returnVector3 (opt)) returns {Vector3}

Returns a Vector3 containing the coordinates for this SceneObject within the given Camera's view area. The camera's view area bounds are confined to x within [-.5, .5] and y within [-.5, .5] where -.5 corresponds to left and bottom.

Parameters:
Name Type Attributes Default Description
camera Camera  

The Camera to 'look through' when obtaining the view position of this SceneObject. [DEFAULT: nc.mainCamera]

returnVector3 Vector3 <optional>
 

Optional Vector3 that can be supplied to avoid the generation of a new Vector3 object for efficiency.

Returns:
Vector3
Inherited From:

Example:
// Objective: Get the view position of a SceneObject within a Camera's view area
// Expected Result: The console should have 2 log messages that look something like the following:
//    'MyGraphicObject' view position x,y 0.030978934324659233 0
//    'MyGraphicObject' view position x,y 0.061957868649318466 0
//
// NOTE: Because view position is relative to the Camera's view area, your x value will depend on the resolution of your screen. 
//       Try resizing your screen and running the test again. You will notice your x value has changed.
//

// Using the GraphicObject constructor, add a GraphicObject named "MyGraphicObject" to the main scene
let myGraphicObject = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "MyGraphicObject" );
// Update the x position of myGraphicObject, moving it to the right 100 world units.
myGraphicObject.position.x = 100;
// Console log the x and y of "MyGraphicObject" using getViewPosition(). 
console.log( "'MyGraphicObject' view position x,y", myGraphicObject.getViewPosition().x, myGraphicObject.getViewPosition().y );
// Update the x position of myGraphicObject again, moving it to the right 200 world units.
myGraphicObject.position.x = 200;
// Console log the x and y of "MyGraphicObject" using getViewPosition(). 
console.log( "'MyGraphicObject' view position x,y", myGraphicObject.getViewPosition().x, myGraphicObject.getViewPosition().y );

justifyAll(justification)

Applies the given justification to all of the LayoutStack's elements. Calling this method also sets an internal default, so that when new SceneObjects that have never been configured as LayoutObjects are added as elements, the given justification will be applied.

Parameters:
Name Type Attributes Default Description
justification string    

The justification to apply to all of the LayoutStack's elements. For a list of justifications see 'nc.constants.justifications'.

Inherited From:

removeDisposalCallback(callbackOwner, callbackName)

Removes the given callback function from the list of callbacks that occur when this SceneObject is disposed.

Parameters:
Name Type Attributes Default Description
callbackOwner object    

The object owning the callback function that is called when this SceneObject is disposed.

callbackName string    

The name of the function that is called when this SceneObject is disposed.

Inherited From:

removeElement(element, dispose (opt))

Removes the given element from the LayoutStack.

Parameters:
Name Type Attributes Default Description
element object  

The element to remove.

dispose boolean <optional>
 

Boolean determining if the item is disposed. [DEFAULT: true]

Inherited From:

removeElementAt(index, dispose (opt))

Removes the element at the given index.

Parameters:
Name Type Attributes Default Description
index number  

The index of the element to remove.

dispose boolean <optional>
 

Boolean determining of the item is disposed. [DEFAULT: true]

Inherited From:

removeEnabledStateChangeCallback(callbackOwner, callbackName)

Removes an 'enabledStateChange' callback.

Parameters:
Name Type Attributes Default Description
callbackOwner object    

The object owning the callback function to remove.

callbackName string    

The name of the callback function to remove.

Inherited From:

Example:
// Objective: Add an 'Enabled State Change' callback.
// Expected Result: The console should have 2 log messages as follows:
//    enabled state is false
//    enabled state is true

// Create a SceneObject using the SceneObject constructor. This will add "MySceneObject" to the main scene.
this.mySceneObject = new SceneObject( nc.mainScene, "MySceneObject" );

// Add a callback function.
this.myCallback = function(args) {
    console.log('enabled state is', args);
}

// Add a reference to a callback function passing the owner of the function and the function name.
this.mySceneObject.addEnabledStateChangeCallback( this, "myCallback" );
// Set mySceneObject to enabled = false. This will fire an enabled state change callback.
this.mySceneObject.enabled = false;
// Set mySceneObject to enabled = true. This will fire an enabled state change callback.
this.mySceneObject.enabled = true;
// Remove the reference to a callback function passing the owner of the function and the function name.
this.mySceneObject.removeEnabledStateChangeCallback( this, "myCallback" );
// Set mySceneObject to enabled = false. This will NO LONGER fire an enabled state change callback and no console message will be logged.
this.mySceneObject.enabled = false;

removeTriggerCallback(callbackOwner, callbackName)

Removes the given trigger callback.

Parameters:
Name Type Attributes Default Description
callbackOwner object    

The object owning the callback to be removed.

callbackName string    

The name of the callback to be removed.

Inherited From:

setEffectNodes(effectNodes, alsoSetDescendants (opt))

Sets the EffectNodes for the Materials associated with this SceneObject.
EffectNodes are GPU-driven visual effects assigned to SceneObjects, GraphicObjects, and ultimately Materials. Each EffectNode can be manipulated dynamically by one or more EffectControllers, which are accessable as direct members of the given SceneObject or Material. When a GraphicObject is set to a particular GraphicAsset, it's Materials adopt the GraphicAsset's EffectNode and EffectController presets by default, but they can be customized at any time.

Parameters:
Name Type Attributes Default Description
effectNodes Array.<EffectNode> | EffectNode  

The new list of EffectNodes that will apply to the Materials associated with this SceneObject.

alsoSetDescendants boolean <optional>
true

Boolean determining if this SceneObject's descendants' Materials will also adopt the provided list of EffectNodes. [DEFAULT: true]

Inherited From:

setLayers(layer, sceneObjectList (opt))

Sets the Layers of all of the GraphicObject descendants of this SceneObject to the supplied Layer.

Parameters:
Name Type Attributes Default Description
layer Layer  

The layer to change this SceneObject's descendants to.

sceneObjectList Array.<SceneObject> <optional>
 

Optional list designating exactly which decendants to set the layers for. If left undefined, all GraphicObject descendants' layers will be updated.

Inherited From:

Example:
// Objective: Swap the position of GraphicObjects using setLayers().
// Action: Click the white triangle Button to swap the layering of the red and white boxes.
// Expected Result: Upon clicking the white triangle Button, the red and white boxes will swap positions.

// Start by creating 2 different GraphicObjects, red and white.
let redBox = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "RedBox" );
redBox.fillColor = new Color( 1,0,0,1 ); // make the white box red

let whiteBox = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "WhiteBox" );
// Offset the White Box, 25 world units, down and to the right.
whiteBox.position.x = 25;
whiteBox.position.y = -25;

// Define a new Layer named "LayerA" and set the red box to "LayerA".
nc.defineLayer( "LayerA", nc.mainScene );
redBox.layer = nc.layers.LayerA;
// Define a new Layer named "LayerB" and set the white box to "LayerB".
nc.defineLayer( "LayerB", nc.mainScene );
whiteBox.layer = nc.layers.LayerB;

// Using the nc factory method, create a white triangle button to handle the action of swapping layers.
let button = nc.addButton( nc.graphicAssets.WhiteTriangle, nc.mainScene, "MyButton" );
button.position.x = -120; // offset the button to the left
// Add a button callback function.
this.mySwapCallback = function(args) {
    // Swap the red and white Layers of the boxes.
    if ( redBox.layer === nc.layers.LayerA ) {
        redBox.setLayers( nc.layers.LayerB );
        whiteBox.setLayers( nc.layers.LayerA );
    } else {
        redBox.setLayers( nc.layers.LayerA );
        whiteBox.setLayers( nc.layers.LayerB );
    }
}
// Add a reference to a callback function passing the owner of the function and the function name.
button.addReleaseCallback( this, "mySwapCallback" );

setParent(parent, maintainGlobalPosition (opt))

Makes this SceneObject the child of the given SceneObject in the hierachy.

Parameters:
Name Type Attributes Default Description
parent SceneObject  

The SceneObject that will become this SceneObject's new parent.

maintainGlobalPosition boolean <optional>
 

Boolean determining if the global position, scale, and rotation should be preserved during the change in hierarchy. Note that this preservation is not always possible during a parent change. [DEFAULT: false]

Inherited From:

Example:
// Objective: Set the parent of a SceneObject
// Expected Result: The console should have 2 log messages as follows:
//    GraphicObjectChild's parent is GraphicObjectA
//    GraphicObjectChild's parent is now GraphicObjectB

// Create a GraphicObject using the GraphicObject constructor. Name it "GraphicObjectA".
let graphicObjectA = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "GraphicObjectA" );
// Create a second GraphicObject using the GraphicObject constructor. Name it "GraphicObjectB".
let graphicObjectB = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "GraphicObjectB" );
// Create a third GraphicObject using the GraphicObject constructor. This time, make its parent graphicObjectA. Name it "GraphicObjectChild".
let graphicObjectChild = new GraphicObject( nc.graphicAssets.WhiteBox, graphicObjectA, "GraphicObjectChild" );
// Console log the parent.
console.log("GraphicObjectChild's parent is", graphicObjectChild.parent.name);
// Set the parent to graphicObjectB.
graphicObjectChild.setParent( graphicObjectB );
// Console log the parent.
console.log("GraphicObjectChild's parent is now", graphicObjectChild.parent.name);

setSubLayers(subLayer, sceneObjectList (opt))

Sets the SubLayer values of all of the GraphicObject descendants of this SceneObject to the supplied subLayer value.

Parameters:
Name Type Attributes Default Description
subLayer Layer  

The subLayer to change this SceneObject's descendants to.

sceneObjectList Array.<SceneObject> <optional>
 

Optional list designating exactly which decendants to set the layers for. If left undefined, all GraphicObject descendants' layers will be updated.

Inherited From:

swoopGlobalPosition(endValues, duration (opt), tweenType (opt), completionCallbackOwner (opt), completionCallbackName (opt), completionCallbackArgs (opt), pauseImmunity (opt), speedControl (opt)) returns {Swooper}

Swoops this SceneObject's position using global coordinates.

Parameters:
Name Type Attributes Default Description
endValues Array.<number>  

The array of target global position values [x,y,z].

duration number <optional>
0

The duration for the interpolation in seconds. [DEFAULT: 0]

tweenType TweenType <optional>
nc.tweenTypes.Linear

The TweenType, determining the method of interpolation. [DEFAULT: nc.tweenTypes.Linear]

completionCallbackOwner object <optional>
 

The object owning the callback function that is called when the Swooper completes.

completionCallbackName string <optional>
 

The name of the function that is called when the Swooper completes.

completionCallbackArgs Array | any <optional>
 

Arguments for the function that is called when the Swooper completes.

pauseImmunity PauseEvent | Array.<PauseEvent> <optional>
nc.defaultPauseImmunity

The PauseEvent or Array of PauseEvents that this Swooper will be immune to. Set this parameter to [] to create callbacks with no immunity. If this parameter is left undefined, the current value of 'nc.defaultPauseImmunity' will be used. The value for 'nc.defaultPauseImmunity' defaults to [], but can be changed at any time. [DEFAULT: nc.defaultPauseImmunity]

speedControl SpeedControl | Array.<SpeedControl> <optional>
nc.defaultSpeedControl

The SpeedControl or Array of SpeedControls that this Swooper is affected by. [DEFAULT: nc.defaultSpeedControl]

Returns:
Swooper
Inherited From:

Example:
// Objective: "Swoop" the position of the white box.
// Expected Result: The white box moves up and to the right, 300 world units, over a duration of 10 seconds.
 
// Add a GraphicObject to the main scene using the GraphicObject constructor.  
let whiteBox = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "WhiteBox" );
// Call swoopGlobalPosition() giving it the array of x,y,z values to swoop to over a duration of 10 seconds.
whiteBox.swoopGlobalPosition( [300,300,0], 10 );

swoopGlobalScale(endValues, duration (opt), tweenType (opt), completionCallbackOwner (opt), completionCallbackName (opt), completionCallbackArgs (opt), pauseImmunity (opt), speedControl (opt)) returns {Swooper}

Swoops this SceneObject's scale using global coordinates.

Parameters:
Name Type Attributes Default Description
endValues Array.<number>  

The array of target global scale values [x,y,z].

duration number <optional>
0

The duration for the interpolation. [DEFAULT: 0]

tweenType TweenType <optional>
nc.tweenTypes.Linear

The TweenType, determining the method of interpolation. [DEFAULT: nc.tweenTypes.Linear]

completionCallbackOwner object <optional>
 

The object owning the callback function that is called when the Swooper completes.

completionCallbackName string <optional>
 

The name of the function that is called when the Swooper completes.

completionCallbackArgs Array | any <optional>
 

Arguments for the function that is called when the Swooper completes.

pauseImmunity PauseEvent | Array.<PauseEvent> <optional>
nc.defaultPauseImmunity

The PauseEvent or Array of PauseEvents that this Swooper will be immune to. Set this parameter to [] to create callbacks with no immunity. If this parameter is left undefined, the current value of 'nc.defaultPauseImmunity' will be used. The value for 'nc.defaultPauseImmunity' defaults to [], but can be changed at any time. [DEFAULT: nc.defaultPauseImmunity]

speedControl SpeedControl | Array.<SpeedControl> <optional>
nc.defaultSpeedControl

The SpeedControl or Array of SpeedControls that this Swooper is affected by. [DEFAULT: nc.defaultSpeedControl]

Returns:
Swooper
Inherited From:

Example:
// Objective: "Swoop" the scale of the white box.
// Expected Result: The white box expands to 5 times its original size over a duration of 10 seconds.
  
// Add a GraphicObject to the main scene using the GraphicObject constructor.  
let whiteBox = new GraphicObject( nc.graphicAssets.WhiteBox, nc.mainScene, "WhiteBox" );
// Call swoopGlobalScale() giving it the array of x,y,z values to expand to over a duration of 10 seconds.
whiteBox.swoopGlobalScale( [5,5,0], 10 );