- Home /
Question by
GoGamingJoe · Jun 10, 2014 at 03:56 PM ·
texturegui-button
GUI.Button With Text And Image
Hi I would like to know if anyone knows how to get a Text And A Image/Texture I know you can do it with GUIConnent but I'm using a list to create it and I'm not shure if GUIConntent will work.
Script
public List<GUIListThings> ListPramiters = new List<GUIListThings>();
float GUIBoxPos = 10;
int i = 0;
public GUIStyle Style;
void OnGUI(){
for(i = 0; i < ListPramiters.Count; i++)
{
if(GUI.Button(new Rect(10 ,GUIBoxPos + (i * 60),Screen.width - 20 , 50),ListPramiters[i].LevelIcon + ListPramiters[i].NameOfLevel, Style)){
Debug.Log("Download");
}
}
}
}
[System.Serializable]
public class GUIListThings{
public string NameOfLevel;
public Texture2D LevelIcon;
public string NameOfCreator;
public int ThisWeeksDownloads;
}
Comment