在Unity3D中更改按钮的边框颜色 [英] Change the border's color of a button in Unity3D
问题描述
一个月以来,我开始使用Unity3D,我正在尝试制作一个包含菜单的应用程序,该菜单由面板和几个按钮组成.目前,我正在尝试自定义菜单,更改面板和按钮的填充颜色,但是直到现在我仍无法更改按钮的边框颜色.有什么方法可以自定义UI按钮的边框颜色?多谢您的协助. :)
I began to work with Unity3D since one month and I'm trying to do an application which contains a menu, composed by a panel and several buttons. At this moment, I'm trying to customize the menu, I change the fill color of the panel and buttons, but until now I could not change the border color of the buttons. There is any way to customize the border's color of the UI buttons? I would appreciate your help. :)
推荐答案
不,您不能仅更改边框颜色.如果您使用默认按钮,请查看源图像.它基本上是带有黑色边框的灰色正方形.因此,当您更改图像的颜色时,黑色保持黑色. 要根据需要自定义按钮,您需要创建嵌套的UI元素:
No, you can not change just border color. If you use default buttons, take a look at Source image. It is basically a grey square with black borders. So when you change color of image black color remains black. To customize buttons as you want you need either create nested UI elements:
或使用所需颜色创建精灵并替换源图像
or create sprites with colors you want and replace source image
这篇关于在Unity3D中更改按钮的边框颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!