Making Pretty Gui Buttons

Hi all,

I’m having a hard time making pretty gui buttons. I can use photoshop and all that, but my buttons are strange… I don’t know how to format them or something.

I am using a bitmap I make in PS in .png format so that I can have rounded corners with transparent backgrounds and that’s okay, but my buttons distort depending on the shape of the GUI button. GUI’s default buttons stay pretty and nice no matter what shape they are in.

What am I missing? Do I need to use GUI Textures instead?

I’m sorry but this forum isn’t allowing me to add screenshots of my ugly button. idk why. usually works.

Please if someone can point me in the right direction to learn more about this so I can make pretty buttons. I have been searching but have not been able to find any good leads.

Thank you!!!

I common solution to the general problem you refer to (I believe) is to divide up the area corresponding to the button, background element, etc. into 9 regions: 4 ‘corner’ regions, 4 ‘side’ regions, and the interior. Different textures and/or texture coordinates are used for each region. For the corners, a ‘corner’ texture/image or part of a texture/image is used, and similarly for the edges and the interior. This way, the corner and edge dimensions can remain the same regardless of the dimensions of the control itself. (Of course the size of the control needs to be at least twice that of the edge elements.)

That said, I don’t know how Unity handles its built-in controls in Unity, and I don’t know if or how the above solution could be integrated with the GUI system (I suspect that it couldn’t be, and that you’d have to implement your own system, at least for the display elements.) I don’t really know Unity’s GUI system inside and out though, so maybe there’s an easy (or at least easier) solution that someone will be able to recommend.

Thanks, Jesse,

From what I’ve read, there’s a different class of object called GUI textures which operates in that way, but they are actual GameObjects in your Scene. They are good for surrounding GUI Elements like main menus and mini-maps, but not so much for individual buttons and the like.

Still searching!

Any other ideas are equally welcome!

Set the border values of the GUI style to the correct number of pixels for your graphics.

–Eric

Eric, you rock!

Once again…

Eric, you have solved another problem for me and…
Eric, you ROCK!

:smile: