Constructor
new JWireframeRender(mouse, optionsopt)
Parameters:
Name |
Type |
Attributes |
Default |
Description |
mouse |
Matter.Mouse
|
|
|
`Matter.js` mouse instance. |
options |
physics.JWireframeRender.Options
|
<optional>
|
null
|
Configuration object. |
- Source:
Example
didLoad(ev){
// ...
this.jrender = ...
this.jrunner = ...
this.mouse = ...
if (true){
let jwireframeRender = new physics.JWireframeRender(this.mouse, {lineThickness:1.0, ptsPerMeterFactor: this.jrender.ptm});
this.addChild(jwireframeRender); // Should be auto disposed on scene dispose
this.jrunner.renders.push(jwireframeRender); // Attach to runner.render list
}
this.ready();
}
Extends
Methods
dashedLineTo(from, to, dashopt, gapopt, offsetPercopt)
A drop in replacement for `Graphics.lineTo` that plots dashed lines.
Parameters:
Name |
Type |
Attributes |
Default |
Description |
from |
Vector
|
|
|
Starting point. |
to |
Vector
|
|
|
End point. |
dash |
number
|
<optional>
|
16.0
|
Dash distance, in points. |
gap |
number
|
<optional>
|
8.0
|
Gap distance, in points. |
offsetPerc |
number
|
<optional>
|
0.0
|
Optional offset percentage (0.0-1.0) of dash pattern. Percentage is applied to the sum of `dash` + `gap`. |
- Overrides:
- Source:
Type Definitions
Options
JWireframeRender config options. *
Type:
Properties:
Name |
Type |
Attributes |
Default |
Description |
lineThickness |
number
|
<optional>
|
3.0
|
The line thickness for the render, in screen pts (css). |
ptsPerMeterFactor |
number
|
<optional>
|
1.0
|
Art points to `matter.js` meters factor. Should match that of the main JRender. |
- Source: