- Home /
How to preserve image quality when putting image on a cube for buttons
I'm using buttons made out of a thin cube with a picture on it. I'm using this instead of onGUI to improve game performance. However, when I put the icons (pngs) on the cubes, they look distorted. The edges look ragged and the whole image looks muffled. I already checked that it wasn't because the picture was too small or big for the cube. It also doesn't help to adjust the camera distance. Could you please advise on how to make a picture on a button look as much like the original picture when it's in unity?
Here's an example:
original picture
picture on a unity cube (you can ignore the black background):
I don't think that OnGUI()
is nearly enough of a killer on performance that you'd not want this in the GUI, but I would assume that your image is in fact too large to fit on the cube 1 to 1. You may notice large performance issues with getting this picture on the GUI if you were to do something like Resources.Load
within the OnGUI()
function.
I forgot to mention that I was concerned about performance because I'm building for the iphone and I want to do mul$$anonymous$$ch. Thank you for the advice on the image again--the "truecolor" change that jspease recommended has worked best
Answer by jspease · Jun 15, 2012 at 06:09 AM
Try doing both of these:
Change the Texture Type from "Texture" to "GUI" in the texture settings of the Info texture.
Change the Format from "Compressed" to "Truecolor" in the texture settings of the Info texture.
Also, I'd use a 4-vertex plane instead of a cube if I were you.
Your answer
Follow this Question
Related Questions
GUI.Label positioning for many device resolutions 1 Answer
GUI, making main page lead into an instructions page 2 Answers
How to get Rect from scene Button ? 1 Answer
Unity 5 GUI system 1 Answer
GUI button doesn't appear on Android 0 Answers