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 a new node type to implement primitives in the GUI #11890

Open
JekSun97 opened this issue Mar 2, 2025 · 1 comment
Open

Add a new node type to implement primitives in the GUI #11890

JekSun97 opened this issue Mar 2, 2025 · 1 comment

Comments

@JekSun97
Copy link

JekSun97 commented Mar 2, 2025

Describe the project you are working on

Level editor for game

Describe the problem or limitation you are having in your project

I'm trying to implement a kind of GUI for my project, but sometimes I have to go into a graphics editor to create textures, a few simple primitives, which slows down the GUI design.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I propose a new base node type, like ColorPolygon, which will be responsible for rendering simple primitives, with it we could render primitives like circle, quadrilateral, lines or a custom object.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

The new node will have methods for displaying polygons in GUI space, this is a kind of analogue of Polygon2D, only for GUI, also we can add several other nodes that will inherit from the new node, such as ColorCircle, ColorRect, ColorLine, etc.

Most likely, this improvement will break compatibility, since the new ColorRect node will be inherited from the new node, with the help of which the rectangle will be drawn.

We can also get a new option for ColorRect, such as fill, and also its absence, as well as other new primitives.

I might look into this once I get the hang of the Control codebase within the engine.

If this enhancement will not be used often, can it be worked around with a few lines of script?

As far as I know no, there are no functions in Control methods for rendering custom primitives as is in 2D, such as Polygon2D, or functions for simple drawing in _draw().

Is there a reason why this should be core and not an add-on in the asset library?

This is a useful feature that already has an analogue in 2D, but is missing in the GUI.

@sockeye-d
Copy link

You can implement custom drawing by overriding the _draw function

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

No branches or pull requests

3 participants