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

Adding Corner Radius on StyleBoxTexture and StyleBoxFlat #1214

Closed
JUNZ1 opened this issue Jul 18, 2020 · 2 comments
Closed

Adding Corner Radius on StyleBoxTexture and StyleBoxFlat #1214

JUNZ1 opened this issue Jul 18, 2020 · 2 comments

Comments

@JUNZ1
Copy link

JUNZ1 commented Jul 18, 2020

Describe the project you are working on:
Working on a Mobile Touch Based Game

Describe the problem or limitation you are having in your project:
StyleBoxTexture and StyleBoxFlat classes should have corner radius property

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
It will give stronger feature to the developers who uses them in their game for native drawing, For the moment these objects corners are 90 degrees and not changable

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
Just adding these properties like added in StyleBoxFlat

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.. You can not draw these elements natively with some rounded corners

Is there a reason why this should be core and not an add-on in the asset library?:
I believe most of the developers want to use native godot classes when they need maximum control in the game..

@Calinou
Copy link
Member

Calinou commented Jul 18, 2020

StyleBoxFlat already has corner radius properties since Godot 3.0. You can play with the corner detail to get beveled or rounded corners.

StyleBoxTexture could technically have a corner radius property as well (which would work as a mask), but I don't think it makes sense. With StyleBoxTexture, you typically use corners that are baked into the texture to improve performance and have greater creative freedom. It's often used in games that use peculiar artstyles or on mobile.

Also, keep in mind rounded corners will cause Godot to use a polygon drawing path instead of a rectangle drawing path, which is much slower.

@JUNZ1
Copy link
Author

JUNZ1 commented Jul 22, 2020

Thank you for return, then i think its much better to make it during asset creation, instead of using godot..

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

2 participants