Describe the project you are working on:
Mobile game
Describe the problem or limitation you are having in your project:
I want to curve my line2d node
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
It's an innovation I call line2d.add_curve_point
Basically add_curve_point method on line2d nodes
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
It creates curve and all you have to choose is whether to have an inward or outward curve but defaults to outward
If this enhancement will not be used often, can it be worked around with a few lines of script?:
No
Is there a reason why this should be core and not an add-on in the asset library?:
Also part of gdscript
But if it curves, it's no longer a line. 馃
Godot already has a Curve2D object that does what you want.
There's no node which could draw the Curve2D resource, so I think the proposal is partially relevant. But yeah I think you could still draw a curve with the Line2D similar to:
$line.points = curve.get_baked_points()
I'm also not sure whether the Line2D name is confusing. It's more like a Polyline2D, and not Segment2D.
Also, the Path2D node does have a curve property which can be set via editor. It's currently not the case for Line2D, so perhaps we're talking about consistency here.
There's no node which could draw the
Curve2Dresource, so I think the proposal is partially relevant. But yeah I think you could still draw a curve with theLine2Dsimilar to:$line.points = curve.get_baked_points()I'm also not sure whether the
Line2Dname is confusing. It's more like aPolyline2D, and notSegment2D.Also, the
Path2Dnode _does_ have acurveproperty which can be set via editor. It's currently not the case forLine2D, so perhaps we're talking about consistency here.
Yes we are talking about consistency and also there is no code for implementing close in Line2d like:
$line2d.close_points()Which means we have to use set the end point to the starting point
@Calinou This proposal is useful for drawing complex shapes like my tooltip UI in the my previous issue
Which means we have to use set the end point to the starting point
Yeah, there are other places where this kind of feature would be useful in the drawing API, see godotengine/godot#34923 and my following comments regarding this.
This is why I suggested the Polyline2D name, because it can be "closed", that's not necessarily the case for Line2D. But likely the "closed" property is something which is an inherent part of the existing Polygon2D class, but there's no way to draw a polygon non-filled with the color (so that only the boundary is visible), so I dunno.
Most helpful comment
But if it curves, it's no longer a line. 馃