Documentation / Node reference / code nodes
code/SDFBox2D
Returns the distance to a 2D rectangle.
Sdf2d
Returns the distance to a rectangle in the XY plane. Its corners can be square, round or chamfered, each with its own size.
Parameters
| Name | Type | What it does |
|---|---|---|
| P | Vector2 | Position to measure from. Unwired, it uses the sample position. |
| t | Vector2 | Rectangle center. |
| size | Vector2 | Length along X and Y, before scale. |
| scale | Float | Multiplies the size and the bevel sizes. |
| bevel | UInt8 NONE · ROUND · CHAMFER | Shape of the corners. |
| bevelSize | Float | Radius or chamfer length of all four corners. |
| cornerSizes | Vector4 | Added to bevelSize per corner, counter-clockwise from top right. |
See also
This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.