PolylineCollider2D
A collider that generates a polyline shape for physics and rendering.
| Type | Name | Interface Description |
|---|---|---|
| Variables | pixelPerUnit: number | • Function: Set or Get the pixel per unit scale for the polyline collider. * Note: Setting this property will trigger a regeneration of the collider geometry. |
| Variables | positions: Array<Vector2f> | • Function: Set or Get the center positions of points in the polyline collider. * Note: Setting this property will trigger a regeneration of the collider geometry. |
| Variables | width: number | • Function: Set or Get the width of the polyline collider. * Note: Setting this property will trigger a regeneration of the collider geometry. |
| Functions | constructor() | |
| Functions | getRenderMesh(): Mesh | null | • Function: Get the visual mesh. If the polyline shape is changed, it updates. to ensure you get the valid state. |
Examples
constructor()
let obj = new APJS.PolylineCollider2D();
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use PolylineCollider2D here
}
onUpdate(deltaTime: number) {
}
}