Hello, i want to ask about how to insert a custom image i create to the GUI.Box?
as far as i do, the code is like this
function OnGUI(){
var judul : String;
var asd : Texture;
GUI.Box(Rect((Screen.width-(Screen.width/4*3))/2,
(Screen.height-(Screen.height/4*3))/2,
Screen.width/4*3, Screen.height/4*3),asd);
}
i create a fair good amount of Gui Rect Box… but i still dont understand how to change the Black background of the GUI.Box into the Images i want, i found out on Unity Documentation, it comes out like this…
static function Box(position: Rect, text: string): void;
static function Box(position: Rect, image: Texture): void;
static function Box(position: Rect, content: GUIContent): void;
static function Box(position: Rect, text: string, style: GUIStyle): void;
static function Box(position: Rect, image: Texture, style: GUIStyle): void;
static function Box(position: Rect, content: GUIContent, style: GUIStyle): void;
but there is no example to how inserting new image… could anybody teach me how to do it?
EDIT :
I’ve been searching about this, but some use GUI Skin, and i don’t quite understand about that, do i need to use that? or i could do this by code instead?