Same default size as with GradientTexture2D, big enough for decent fidelity, small enough not to fill the screen for low-res projects. Personally I think the best solution would be just to add actual specific 2D primitive shapes to the MeshInstance2D node and remove all these 3D shapes which just come with unnecessary overhead, not the right setting options for 2D etc. However because they are resources, they also have to be made unique every time, which is very easy to forget or miss and can easily ruin a lot of work.Įdit Note: For Godot 3.X there are also some plugins: Primitives2D, using AntialiasedRegularPolygon2D from the Antialiased Line2D plugin. Figuring out what settings to do what and get them right is not intuitive or fun at all.Īll of these are Resources though, so they can be saved and reused. However it is also rather tedious and quite fiddly to set up. Works ok for simple squares, rectangles and circles. Using Sprite2D with GradientTexture2D as texture: Even though you can add a material and a texture to the albedo, it won't show up. ![]() If you add a Texture to any shape other than the Quad, it has a seam right in the middle splitting the texture and there is no way to shift UVs. For example the TorusMesh renders as Pill, the PlaneMesh not at all (it is rotated in side view). Some shapes are not rendered in the expected orientation, there is no option to rotate the shape. ![]() Their default sizes match the 3D unit (0.5 to 2) which is rendered as 0.5 to 2 pixel in 2D, so the user always has to adjust parameters just to see the shape. However since these are not 2D but 3D primitive meshes, they are not optimized for 2D use. Works ok for basic Primitives like circles, squares, rectangles, triangles, pill shapes. Anything is possible, but it's not user friendly, especially for geometric primitives. Has already been mentioned in this thread, requires the user to write some math code to generate the geometric shapes or draw them by hand. Just want to add some currently available workarounds (as of Godot 3.5.2 stable and Godot 4.1.1 stable) Creating a dedicated class for visualizing shapes is probably the best idea, but that means adding another class in Godot, which is bloat. Some features/bug-fix can be ported to Godot (like godotengine/godot#21394), as VisualShape2D in goostengine/goost#2 does allow editing polygon-based shapes already (with some limitations), and I could probably work on that as well.ĮDIT: On the other hand, you'd have to make similar thing for CollisionPolygon2D, and perhaps some other node which would use a Shape2D in the future (other than physics), so might not be worth it. allow editing of polygon-based shapes: ConvexPolygonShape2D can't be edited with mouse like CollisionPolygon2D godot#21394, also see my comment there.optionally bypass the "Visible Collision Shapes" debug option (so that the shapes could be seen when exported in release).override debug color for drawing (per each node, and not globally).So, in order to possibly address this issue on the core level, it would be just nice for the CollisionShape2D to: So, it might be safe to say that, in most cases, the need to draw shapes comes from the need to draw physics bodies without using sprites, and the shape perfectly represents it. ![]() How does this proposal improve the situation?Īs I'm thinking about it, my particular implementation is quite similar to CollisionShape2D in a way that both share and expose Shape2D resource, and the VisualShape2D allows to specify any color for drawing, and the shape can be synced with use_parent_shape (from CollisionShape2D etc). What steps are you taking and where does the problem occur that you are trying to solve. What exactly are you trying to accomplish? Things likeĪre hard to relate to if we don't know your use case. These proposals usually work better if we understand what you are trying to do and where the problem occurs. This should not have any effect on the character movement. Like what? The Polygon2D node is just a visualization. There are lot of problems using the polygon node to create a shape that is used for character movement ![]() You can use grid snapping in the 2D viewport to make the points' position precise or adjust the values in the inspector. And also the shape is never really accurate Objects that don't require precise position. If your Polygon2D contains the center of your scene, placing instances of your scene should be straight forward and work as expected.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |