EZ Curved Lines 2D
by renevanderark
EZ Curved Lines 2D for Godot 4.4
This plugin helps you draw smooth curved 2D lines, polygons and collision polygons quickly in the 2D editor.
Using godot's AnimationPlayer
you can even create key frames for the curves lines to animate them.
- EZ Curved Lines 2D for Godot 4.4
Quick Start
After activating this plugin via Project > Plugins
follow these steps.
1. Create a new 2D Scene
2. Add a DrawablePath2D
node to you scene tree (Ctrl + A)
3. In the Inspector
tab click the Generate New Line2D
button
4. Start drawing your DrawablePath2D
like a normal Path2D
Adding and manipulating points the normal way you would for a Path2D
.
Creating curves using the Select Control Points
mode:
.
5. You can change the properties of the Line2D
in the inspector
Your new line will update every time you change the Curve2D
of your Path2D
Animating
You can use the Update Curve at Runtime
checkbox to enable dynamic changing of your curved shapes at runtime.
Add keyframes in an animation player
You can then add an AnimationPlayer
node to your scene, create a new animation and create keyframes for your Curve > Points
(in the inspector):
Performance impact
This does, however impact performance of your game somewhat, because calculating curves is an expensive operation.
It should be used sparingly.
Under Tesselation settings
you can lower Max Stages
or bump up Tolerance Degrees
to
reduce curve smoothness and increase performace.
Polygon2D and CollisionPolygon2D - new in version 1.2.0
Version 1.2 adds the exciting new ability to create curved Polygon2D and CollisionPolygon2D!
An updated quick start and youtube explainer will follow as soon as I have some more time available
They can be assigned to the DrawablePath2D node the same way as a Line2D (explained in the quickstart).
Note on assigning CollisinPolygon2D
Note, however, that a CollisionPolygon2D
will at first be generated as a direct child of the DrawablePath2D
using
the Generate CollisionPolygon2D
button, but it does not need to be a child to remain succesfully assigned.
This way you can move it up the hierarchy of your scene to become a direct descendant of a CollisionObject2D
(like Area2D
, StaticBody2D
or CharacterBody2D
)
Examples
A simple animated polygon
Rat's tail
Rotating butterfly net
The start of a leopard face
Explainer on Youtube
Leopard face timelapse on Youtube
Attributions
This plugin was fully inspired by Mark Hedberg's blog on rendering curves in Godot.
The suggestion to support both Polygon2D
and CollisionPolygon2D
was done by GeminiSquishGames
Download
Support
If you need help or have questions about this plugin, please contact the author.
Contact Author