Polygon2D¶
Inherits: Node2D < CanvasItem < Node < Object
A 2D polygon.
Description¶
A Polygon2D is defined by a set of points. Each point is connected to the next, with the final point being connected to the first, resulting in a closed polygon. Polygon2Ds can be filled with color (solid or gradient) or filled with a given texture.
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
void |
add_bone ( NodePath path, PackedFloat32Array weights ) |
void |
clear_bones ( ) |
void |
erase_bone ( int index ) |
get_bone_count ( ) const |
|
get_bone_path ( int index ) const |
|
get_bone_weights ( int index ) const |
|
void |
set_bone_path ( int index, NodePath path ) |
void |
set_bone_weights ( int index, PackedFloat32Array weights ) |
Property Descriptions¶
bool antialiased = false
If true
, polygon edges will be anti-aliased.
Array bones = []
Internal list of Bone2D nodes used by the assigned skeleton. Edited using the Polygon2D editor ("UV" button on the top toolbar).
Color color = Color(1, 1, 1, 1)
The polygon's fill color. If texture
is defined, it will be multiplied by this color. It will also be the default color for vertices not set in vertex_colors
.
int internal_vertex_count = 0
Number of internal vertices, used for UV mapping.
float invert_border = 100.0
Added padding applied to the bounding box when invert_enabled is set to true
. Setting this value too small may result in a "Bad Polygon" error.