Quantcast
Channel: Latest Questions by MasterBLB
Viewing all articles
Browse latest Browse all 44

GUI texture size doesn't match control set with the same size

$
0
0
Hello I've imported a .png containing look of a button.I've set texture type to GUI and warp to clamp.The texture has 210x32 pixels. Then,I've created C# script: public class MainMenu : MonoBehaviour { public Texture2D aboutButton; public Texture2D optionsButton; public Texture2D helpButton; float menuButtonWidth = 210; float menuButtonHeight = 32; // Use this for initialization void Start () {} // Update is called once per frame void Update () {} void OnGUI() { GUI.Button(new Rect(20,20,menuButtonWidth,menuButtonHeight),optionsButton); GUI.Button(new Rect(20,62,menuButtonWidth,menuButtonHeight),helpButton); GUI.Button(new Rect(20,104,menuButtonWidth,menuButtonHeight),aboutButton); } } And my problem is that these button are to large,or the textures are shrinked. What causes my issue,and how to solve it?Help me please.

Viewing all articles
Browse latest Browse all 44

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>