- Home /
How to add images on your scrollbar
so i created a scrollbar and i want an images inside it so what i did is i created a GUISTYLE and attached the image there but i realize that i can only attached 1 image in the GUIstyle so my question is what should I do to attached different images in my scrollbar here's my code
public Vector2 scrollPosition = Vector2.zero;
public GUIStyle EnemyHealthbarBG;
//public GUISkin SKIN = null;
void OnGUI() {
// GUI.skin = SKIN;
GUI.skin.verticalScrollbar.fixedWidth = Screen.width / 30;
GUI.skin.verticalScrollbarThumb.fixedWidth = Screen.width / 30;
scrollPosition = GUI.BeginScrollView(new Rect (Screen.width/6.5f,Screen.height/4,Screen.width/1.27f,Screen.height/1.5f), scrollPosition, new Rect (0,0,0,Screen.height/0.4f));
GUI.Box (new Rect(0,0,Screen.width/1.4f,Screen.height/0.65f),"",EnemyHealthbarBG);
//GUI.Box (new Rect(0,0,Screen.width/0.7f,Screen.height/0.65f),"",EnemyHealthbarBG);
GUI.EndScrollView();
}
}
Comment
Can you elaborate on how you want to attach different images? Perhaps you could draw a sketch for us?
Your answer

Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Enable / Disable an Image Effect via a button 1 Answer
[CLOSED] When I use this code that I made, it adds to the item catalogue too? [CLOSED] 1 Answer
How to change my stop watch code into real time? 2 Answers
how to change Font size, Type and position of this code? (C#) 1 Answer