shape2d
A 2D primitive at the node, tinted by color and drawn with texture: shape is a circle, rectangle, capsule, ellipse, star or ngon, and the dimensions that…
On this page
2d · render · 4 properties · 2D
A 2D primitive at the node, tinted by color and drawn with texture: shape is a circle, rectangle, capsule, ellipse, star or ngon, and the dimensions that kind reads. A stroked line is line2d.
In a scene, shape2d is the node key that applies it. A script reaches each property below as a field on node.shape2d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.shape2d.get() and node.shape2d.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
color |
color | [0.8,0.8,0.8,1] |
Tint, as channel floats or #rrggbb / #rrggbbaa |
material |
asset · material |
— | The material this draws with; empty draws with the built-in one |
shape |
variant | {"corner_radius":0,"kind":"rectangle","segments":32,"size":[1,1]} |
The shape drawn, and its dimensions |
texture |
asset · texture |
— | An image, or a texture asset, the shape draws with over its own UVs |