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

ConstructDefinition()

ConstructDefinitions house the defining attributes of Constructs. To create an instance of a given Construct, use 'nc.myConstruct.add()'. [NON-INSTANTIABLE]

new ConstructDefinition()

MEMBERS

blueprint :object

Object defining the Construct's composition and layout.

name :string

The name of the ConstructDefinition.

type :string

Type identifier.

unitsPerPixel :Array.<number>

Array of numbers that multiply all of the positions and scales related to this Construct.

METHODS

add(parent (opt), name (opt))

Adds an instance of this Construct to the given parent.

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

The SceneObject that will be the parent of the newly added Construct instance. [DEFAULT: nc.mainScene]

name string <optional>
 

The name of the newly added Construct instance. If left undefined, this propery will default to the name of the Construct.

getPortableObject()

Returns an object version of the ConstructDefinition equivalent to the '.construct' file that defines this Construct.