Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SolidShape2D class #16483

Closed
wants to merge 1 commit into from
Closed

Conversation

kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Feb 8, 2018

SolidShape2D
Fixes #6750
solidshapes
Adds a new class SolidShape2D that draws a Shape2D to the screen.
Similar to Polygon2D but it draws a selected shape in a color.

@vnen
Copy link
Member

vnen commented Feb 8, 2018

The icon is strange because it's not solid.

@kitbdev kitbdev force-pushed the solid_shape_2d branch 2 times, most recently from 878aa7f to ebee554 Compare February 8, 2018 13:28
@kitbdev
Copy link
Contributor Author

kitbdev commented Feb 8, 2018

updated icon to be solid
solidshapes2

@@ -0,0 +1,103 @@
/*************************************************************************/
/* solid_shape_2d.cpp */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*/ is not aligned. 😛

@akien-mga akien-mga added this to the 3.1 milestone Feb 14, 2018
@toby3d
Copy link
Contributor

toby3d commented Mar 9, 2018

Does this node support drawing only the edges, without pouring?
If yes (which would be cool), then, probably, the current node name is not entirely correct.

@kitbdev
Copy link
Contributor Author

kitbdev commented Mar 9, 2018

@toby3d Nope, there is no edge only drawing support. All this class does is use the existing shape2d class to draw. I couldn't call it Shape 2D as it was taken so I went for Solid Shape 2D. If you have any suggestions for the name, let me know!

@toby3d
Copy link
Contributor

toby3d commented Mar 9, 2018

@ianb96 Wait, Godot now support drawing simple figures by Shape2D?

@kitbdev
Copy link
Contributor Author

kitbdev commented Mar 9, 2018

@toby3d No, Shape2D is just used to select the shape type, like circle, square, or arrow. It is used in CollisionShape2D, and it can draw to the screen, but only to show you what the collision will be like. You cannot make your own Shape2D Node to add to your scene.

@eon-s
Copy link
Contributor

eon-s commented Mar 10, 2018

Solid looks like a physics object, it can be called Geometry2D instead (and probably make use of the new meshes in 2D and textures too, but first may need to be added as it is now).

@reduz
Copy link
Member

reduz commented Apr 8, 2018

I Was thinking that, instead of this, a CSG system for 2D and 3D could be done..

@kitbdev
Copy link
Contributor Author

kitbdev commented Apr 9, 2018

A Constructive Solid Geometry system sounds good, I haven't heard of a 2D version of it before.
Related #17411 ?
This PR is just a simple wrapper class for prototyping purposes, so we don't have to merge it or anything.
Although, a full CSG system may take a while to implement and this could be a quick temporary solution.

@akien-mga
Copy link
Member

akien-mga commented May 1, 2018

We briefly discussed it with @reduz and feel that this would be better suited as a GDScript addon defining a custom node type, instead of new core Node. You can see CircleContainer for a 2.1 example of how to register such a custom node type.

Sorry for the huge delay reviewing it though, we're still catching up with the 3.0 release backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants