- Home /
Question by
htsoft · Nov 30, 2012 at 12:52 AM ·
guitexturesgui.button
GUI.Button doesn't show texture
Hi,
in my project I've one GUI.Button and ten GUI.RepeatButton. At each button is assigned a Rect and a Texture.
All buttons are made in this way:
var resetAll : Texture;
var zoomIn : Texture;
var zoomOut : Texture;
var rotateRight : Texture;
var rotateLeft : Texture;
var rotateUp : Texture;
var rotateDown : Texture;
var rotateUpRight : Texture;
var rotateDownRight : Texture;
var rotateUpLeft : Texture;
var rotateDownLeft : Texture;
if(GUI.Button(new Rect(526,38,32,32), resetAll)) {
}
if(GUI.RepeatButton(new Rect(458,4,32,32),zoomIn)) {
}
if(GUI.RepeatButton(new Rect(458,72,32,32),zoomOut)) {
}
if(GUI.RepeatButton(new Rect(560,4,32,32),rotateUpRight)) {
}
if(GUI.RepeatButton(new Rect(560,72,32,32),rotateDownRight)) {
}
if(GUI.RepeatButton(new Rect(492,4,32,32),rotateUpLeft)) {
}
if(GUI.RepeatButton(new Rect(492,72,32,32),rotateDownLeft)) {
}
if(GUI.RepeatButton(new Rect(560,38,32,32),rotateRight)) {
}
if(GUI.RepeatButton(new Rect(526,4,32,32), rotateUp)) {
}
if(GUI.RepeatButton(new Rect(526,72,32,32),rotateDown)) {
}
if(GUI.RepeatButton(new Rect(492,38,32,32),rotateLeft)) {
}
The buttons are displayed and they works fine but no texture is showed in each button.
I've assigned textures (32x32 px PNG format) via Inspector with Drag and Drop.
How can i solve this issue?
Thanks in advance.
Comment
Your answer
Follow this Question
Related Questions
GameObject duplicates every time my GUI button is pressed 1 Answer
GUI Skin Custom textures in C# 2 Answers
Hold Down GUIButton? 1 Answer
Chat Client in Unity 1 Answer
How do I make a round minimap? 2 Answers