Function: from()
ts
function from<T>(json): T;Defined in: index.ts:91
Construct Pencil.js objects (and their children) from a JSON definition
Type Parameters
| Type Parameter | Default type |
|---|---|
T | any |
Parameters
| Parameter | Type | Description |
|---|---|---|
json | Definition | Valid JSON definition (from any toJSON call) |
Returns
T
Example
ts
const copy = from(JSON.parse(JSON.stringify(scene)));