0 votes

I want to create a button or sprite with the background color red and with rounded corners(circle)

in Engine by (12 points)

3 Answers

+3 votes

You can draw your circular button in a painting program, then use a TextureButton to apply the image on it. http://docs.godotengine.org/en/stable/classes/class_texturebutton.html

by (27,164 points)
–1 vote

The first thing I did, was create a polygon2D, create a circle with it. If you want to create the actual button, then I would go on paint, and I would use the circle tool to make a red, or whatever color you want it to be, and fill it in with that color. Next, you could select it, and copy it on to a piece of paper on word, and put that image into your godot folder. Now you can insert your red button into the polygon2D section, and wala, you got your self a noob way to make a button!

by (43 points)
+4 votes

You can create a button and add a StyleBoxFlat within the Custom Styles panel:

Custom styles panel

Then adjust the Corner Radius properties:

Corner radius

You can also do it from a script.

More info here: http://docs.godotengine.org/en/3.0/classes/class_styleboxflat.html

by (31 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories