S
Publisher
squiggelsquirrel
Vector Shape Nodes 2D
2D
Vector Shape Curve Tweening Visual Control GDScript Path
These scripts allow vector shapes (i.e. curve path with fill and/or stroke) to be created and controlled by Node2D points and handles. This allows shapes to be tweened easily using AnimationPlayer, etc. The stroke width can also be set on each point.
This plugin has been mirrored from the Godot Asset Library.
The plugin author is in no way affiliated with Gadget.
If you are the author of this plugin and would like this mirror removed, please contact support@gadgetgodot.com.
VectorNode
Create shapes with fill/stroke from Node2D control points
Note: As of 1.7.0 I recommend using with the Bit Flags Editor plugin: https://github.com/SquiggelSquirrel/BitFlagEditor
VectorPath
- Defines the path to fill/stroke
- Add VectorPoint nodes for each point on the path
- Emits the
shape_changedsignal when the path changes - Emits the
stroke_data_changedsignal when the stroke widths and/or colors change - Sets the default bake interval for the shape
- Has editor-preview-only color settings for handle-in, handle-out and path
- Uses VectorPoint to define stroke widths & colors, and specific bake intervals
- Can define an array of tag name strings (only for editor UI purposes), for use with VectorPoint "tags" bitmask
VectorPoint
- Defines a single point in a vector path
- Use as child of VectorPath or VectorPointGroup
- Add VectorHandle nodes to define the vector in/out
- Can specify a stroke width and/or color
- (will only apply to VectorStroke nodes with
use_data_nodes_widthoruse_data_nodes_colorset
- (will only apply to VectorStroke nodes with
- Can specify a bake interval for outgoing edge
- When set to 0.0, use default value specified on VectorPath node
- Supports different handle types:
- NONE: no handles
- IN: one handle, defines vector in only
- OUT: one handle, defines vector out only
- BOTH: two handles, first defines vector in, second defines vector out
- MIRROR IN: one handle, defines vector in. Vector out is reflection of vector in
- MIRROR OUT: one handle, defines vector out. Vector in is reflection of vector out
- IN OUT: one handle, defines vector in and vector out as same vector
- Points and handles use position relative to VectorPath, so rotating/scaling a VectorPoint can change the handle position
- Has an integer bitmask of tags, which can be used by fill and stroke to filter for different sub-paths
VectorHandle
- Defines vector in/out for a VectorPoint (see above)
- Has an integer bitmask of tags, which can be used by fill and stroke to filter for different sub-paths
VectorControl
- Abstract class defining shared behaviour of VectorPoint and VectorHandle
VectorPointGroup
- Use as child of VectorPath or another VectorPointGroup
- Usually contains one or more VectorPoints and/or other VectorPointGroups
- Allows one or more VectorPoints to be moved, rotated, and/or scaled together
VectorFill
- Fills a VectorPath
- Set
path_node_pathto the NodePath of the VectorPath - Call
update_fillto update - Commonly you would connect the VectorPath
shape_changedsignal to theupdate_fillmethod - Has an integer mask (normally I would only set one bit) to specify which VectorControls to use
VectorStroke
- Strokes a VectorPath
- Set
path_node_pathto the NodePath of the VectorPath - Call
update_shapeto update the shape - Call
update_datato update stroke widths and/or colors:- (only if using
use_data_nodes_widthoruse_data_nodes_color)
- (only if using
- Extends Line2D, so also accepts textures, etc.
- Can stroke part of a path - use start/end to define start and end points
- These accept negative values and wrap
- These also now accept floating values, and will interpolate along the path between points
- Has
start_pinch lengthandend_pinch_length, interpolate the width to 0.0 towards the start/end- Lengths are defined as fraction of total stroke length
- Has
use_close_fix, attempts to work around the fact that Line2D cannot be closed by creating a small overlap when the stroke is closed - Commonly you would connect the VectorPath
shape_changedsignal to theupdate_shapemethod - If using width/color, connect
stroke_data_changedtoupdate_datafor automatic updates - Has an integer mask (normally I would only set one bit) to specify which VectorControls to use
VectorCollisionPolygon
- Creates a collision polygon from a VectorPath
- Almost identical to VectorFill
- Call
upadate_polygonto update - Connect
shape_changedtoupdate_polygonfor automatic updates