Topic was automatically imported from the old Question2Answer platform.
Asked By
Suleymanov
Is there any way I can properly close the curve (Path2D)? The first point and the last point are on top of each other but not connected. How can I call the first and last points in the curve? My idea is to make “first_point.position = last_point.position” so that they at least stick together. Or if there are better ways, please let me know.
Thank you for the kind reply. “Close Curve” button doesn’t PROPERLY close it though, it puts points on top of each other instead and they are disconnected, that’s the problem I mentioned above. My game is about in-game curve editing. When a player moves the first/last point, they get apart. Is there any solution to keep them connected?
If you want a curve that stays closed, even when the joining points are dragged about, I think you’ll need to extend Curve2D to build that functionality in. Make it so that the final point’s properties are completely dependent on the first, and then make sure that players cannot move the last point. Other than radical surgery on the Engine itself, I think that’s your most elegant solution, such as it is.
Also, thanks for answering my question: what does the close-curve button in the editor do.